File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes Help with expression Tree Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Reply locked New topic
Author

Help with expression Tree

Dustin Schreader
Ranch Hand

Joined: May 25, 2009
Posts: 102
I'm trying to build an expression tree for the first time. There will be a prefix expression entered and I am thinking that I can check if there is an operator and if there is I can set the root node equal to the operator and if a number is the next character I can and the next char will be an int as well so i'd but I get an error because the interface is set to take TreeNode parameter. How Do I get it to accept an int single as a TreeNode? This is what I have so far.

And this is my interface
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Help with expression Tree