|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectplanet.generic.commonapi.NetworkImpl.NetworkIterator
This class implements the java.util.Iterator interface and is backed
up by TreeMap that contains all existing nodes on the network.
It use the iterator of the TreeMap key set to iterate over all instances
of the nodes, and returns the corresponding Node. It also implements
the remove() method, that uses the same method of the key set iterator.
This last method ensures to remove the required entry on to the TreeMap.
Constructor Summary | |
NetworkImpl.NetworkIterator(java.util.TreeMap nodes)
Initialize the key set iterator over the HashMap. |
Method Summary | |
boolean |
hasNext()
Evaluate if there are more nodes. |
java.lang.Object |
next()
Returns the next Node. |
void |
remove()
Remove the actual element of the HashMap. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public NetworkImpl.NetworkIterator(java.util.TreeMap nodes)
nodes
- Method Detail |
public boolean hasNext()
hasNext
in interface java.util.Iterator
Iterator.hasNext()
public java.lang.Object next()
next
in interface java.util.Iterator
Iterator.next()
public void remove()
remove
in interface java.util.Iterator
Iterator.remove()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |