Class NodeLocation<USERKEY,STOREKEY>
- java.lang.Object
-
- com.github.basking2.sdsai.dsds.node.NodeLocation<USERKEY,STOREKEY>
-
public class NodeLocation<USERKEY,STOREKEY> extends java.lang.ObjectA view ofNodeobjects arranged as a tree with no back links. This will do a depth-first traversal of the tree.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description NodeLocation<USERKEY,STOREKEY>afterMax()This creates a NodeLocation that is positioned in an imaginary node that exists after the last node in the tree.NodeLocation<USERKEY,STOREKEY>beforeMin()This creates a NodeLocation that is positioned in an imaginary node that exists before the first node in the tree.NodeLocation<USERKEY,STOREKEY>descend()NodeLocation<USERKEY,STOREKEY>descend(int child)Node<USERKEY,STOREKEY>getNode()booleanhasNext()booleanhasPrev()NodeLocation<USERKEY,STOREKEY>left()Return this node with the index positioned on the left.NodeLocation<USERKEY,STOREKEY>max()NodeLocation<USERKEY,STOREKEY>min()NodeLocation<USERKEY,STOREKEY>next()NodeLocation<USERKEY,STOREKEY>prev()NodeLocation<USERKEY,STOREKEY>right()Return this node with the index positioned on the Right.
-
-
-
Method Detail
-
hasPrev
public boolean hasPrev()
-
hasNext
public boolean hasNext()
-
descend
public NodeLocation<USERKEY,STOREKEY> descend()
-
descend
public NodeLocation<USERKEY,STOREKEY> descend(int child)
-
right
public NodeLocation<USERKEY,STOREKEY> right()
Return this node with the index positioned on the Right.- Returns:
- this node with the index positioned on the right.
-
left
public NodeLocation<USERKEY,STOREKEY> left()
Return this node with the index positioned on the left.- Returns:
- this node with the index positioned on the left.
-
next
public NodeLocation<USERKEY,STOREKEY> next()
-
prev
public NodeLocation<USERKEY,STOREKEY> prev()
-
beforeMin
public NodeLocation<USERKEY,STOREKEY> beforeMin()
This creates a NodeLocation that is positioned in an imaginary node that exists before the first node in the tree. Used for constructingIterators- Returns:
- a location before the first node in the tree.
-
afterMax
public NodeLocation<USERKEY,STOREKEY> afterMax()
This creates a NodeLocation that is positioned in an imaginary node that exists after the last node in the tree. Used for constructingIterators- Returns:
- a location after the last node in the tree.
-
max
public NodeLocation<USERKEY,STOREKEY> max()
-
min
public NodeLocation<USERKEY,STOREKEY> min()
-
-