All Packages Class Hierarchy This Package Previous Next Index
Class aioli.vtp.BottomUpTreeWalk
java.lang.Object
|
+----aioli.vtp.BottomUpTreeWalk
- public class BottomUpTreeWalk
- extends Object
- implements Iterator
A class that implements a BottomUpTreeWalk
Example of use of the Iterator:
Tree tree;
...
for ( BottomUpTreeWalk i = tree.beginBottomUp();
!i.atEnd(); i.advance() )
if ((Tree)i.get().arity().atomp())
System.out.println((Tree)i.get().operator_name()+" "+(Tree)i.get().atom_value());
else
System.out.println((Tree)i.get().operator_name());
-
advance()
- Advances to the next tree.
-
advance(int)
- Advances by n.
-
atEnd()
- Returns true if I'm positioned after the last item.
-
clone()
- Return a copy of the iterator with the current position.
-
get()
- Returns The object at the current position.
-
isLastElement()
- Returns true when we are on the last element.
-
setPosition(int)
- Sets the new position at n.
clone
public Object clone()
- Return a copy of the iterator with the current position.
- Overrides:
- clone in class Object
get
public Object get()
- Returns The object at the current position.
atEnd
public boolean atEnd()
- Returns true if I'm positioned after the last item.
isLastElement
public boolean isLastElement()
- Returns true when we are on the last element.
advance
public void advance()
- Advances to the next tree.
advance
public void advance(int n)
- Advances by n.
- Parameters:
- n - The increment of the new position.
setPosition
public void setPosition(int n)
- Sets the new position at n.
Not implemented.
does nothing if the new position is out of bound.
- Parameters:
- n - The new position of the Iterator.
All Packages Class Hierarchy This Package Previous Next Index