|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--de.rwth.utils.Position
Describes positions in a tree as sequence of child selection indices from the root.
| Inner Class Summary | |
class |
Position.Entry
Describes a single child selection index; |
| Field Summary | |
protected java.util.Stack |
stack
The representation of the position. |
| Constructor Summary | |
Position()
Creates a new Position instance. |
|
| Method Summary | |
boolean |
empty()
Checks if the Position has no entries. |
Position.Entry |
get(int i)
Returns the element at the specified index (0 for beginning). |
boolean |
isBelow(Position p)
Checks if this position is below another position p. |
java.util.Iterator |
iterator()
Returns an iterator over the entries in this position in proper sequence. |
Position.Entry |
peek()
Looks at the object at the top of this position without removing it. |
Position.Entry |
pop()
Removes the entry at the top of this posotion and returns that entry. |
void |
push(java.lang.Object o,
int i)
Creates a new Entry and pushes it onto the top of this position. |
void |
push(Position.Entry e)
Pushes an entry onto the top of this position. |
int |
size()
Returns the number of components. |
java.lang.String |
toShortString()
Creates a short string representation by omitting the objects in the entries. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected java.util.Stack stack
| Constructor Detail |
public Position()
Position instance.| Method Detail |
public boolean empty()
Position has no entries.boolean valuepublic Position.Entry peek()
Entry valuepublic int size()
int valuepublic void push(Position.Entry e)
e - an Entry value
public void push(java.lang.Object o,
int i)
o - an Object valuei - an int valuepublic Position.Entry pop()
Entry valuepublic Position.Entry get(int i)
i - an int value: postionEntry valuepublic java.util.Iterator iterator()
Iterator valuepublic boolean isBelow(Position p)
p. This is the
case iff p is a prefix of this position.p - a Position valueboolean valuepublic java.lang.String toShortString()
String valuepublic java.lang.String toString()
toString in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||