|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcds.util.TreeHashMap.TreeIterator
Leaf Iterator: returns only the leaf elements from a given node
Field Summary | |
(package private) java.util.Map.Entry |
currEntry
|
(package private) java.util.Iterator |
currIter
|
(package private) int |
currLevel
|
(package private) int |
currState
|
(package private) int |
currType
|
private static int |
ITEM_SET
|
(package private) int |
iteratorType
|
(package private) java.util.Stack |
iters
|
private static int |
LEAF
|
(package private) int |
maxLevel
|
(package private) java.util.Stack |
names
|
private static int |
NO_ITEM
|
private static int |
NODE
|
Constructor Summary | |
protected |
TreeHashMap.TreeIterator()
Constructor without parameters: 1 level, returns only leaves. |
protected |
TreeHashMap.TreeIterator(int iterType)
Constructor with iterator type specification: LEAF, NODE or both |
protected |
TreeHashMap.TreeIterator(int iterType,
int level)
Constuctor with iterator type and level specification |
Method Summary | |
private int |
getType(java.util.Map.Entry item)
|
boolean |
hasNext()
Checks if the iterator has a next element to access |
boolean |
isNode()
Returns true if the current item is a node and false if it is a leaf. |
java.lang.String |
key()
Returns the key nameof the current item, the one which was called by a previous next() or nextKey() method. |
int |
level()
Returns the level of the current item. |
java.util.Map.Entry |
next()
Returns the next item in the TreeHashMap. |
java.lang.String |
nextKey()
Returns the key (always a string) of the 'next item'. |
java.lang.String |
path()
Returns the path of the current item, from its root. |
void |
remove()
|
private boolean |
setNext()
Sets the current item. |
java.lang.Object |
value()
Returns the value of the current item, the one which was called by a previous next() or nextKey() method. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static final int LEAF
private static final int NODE
private static final int NO_ITEM
private static final int ITEM_SET
int maxLevel
int iteratorType
java.util.Stack iters
java.util.Stack names
int currLevel
java.util.Iterator currIter
int currType
java.util.Map.Entry currEntry
int currState
Constructor Detail |
protected TreeHashMap.TreeIterator()
protected TreeHashMap.TreeIterator(int iterType)
iterType
- LEAF, NODE or LEAF|NODEprotected TreeHashMap.TreeIterator(int iterType, int level)
iterType
- LEAF, NODE or LEAF|NODElevel
- max level which the iterator should follow:Method Detail |
private int getType(java.util.Map.Entry item)
private boolean setNext()
public boolean hasNext()
hasNext
in interface TreeHashMapIterator
public java.util.Map.Entry next()
TreeHashMapIterator
next
in interface TreeHashMapIterator
public java.lang.String nextKey()
TreeHashMapIterator
nextKey
in interface TreeHashMapIterator
public java.lang.String key()
TreeHashMapIterator
key
in interface TreeHashMapIterator
public java.lang.Object value()
TreeHashMapIterator
value
in interface TreeHashMapIterator
public int level()
TreeHashMapIterator
level
in interface TreeHashMapIterator
public void remove()
public boolean isNode()
TreeHashMapIterator
isNode
in interface TreeHashMapIterator
public java.lang.String path()
TreeHashMapIterator
path
in interface TreeHashMapIterator
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |