|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectmessif.objects.util.AbstractObjectIterator<E>
messif.objects.util.ObjectIteratorsIterator<E>
E
- iterators typepublic class ObjectIteratorsIterator<E extends AbstractObject>
This class allows iterating over multiple Iterators. The iterotors are accessed in the same order as they were passed in the collection. If actualy iterated iterator has no next object, next iterator (that has object) is selected until whole list of iterators is scanned.
Field Summary | |
---|---|
protected java.util.Iterator<? extends E> |
currentIterator
Iterator from current iterator |
protected E |
currentObject
Stored instance of object returned by the last call to next() |
protected java.util.Queue<java.util.Iterator<? extends E>> |
iterators
Queue of iterators that are waiting to be scanned |
Constructor Summary | |
---|---|
ObjectIteratorsIterator(java.util.Collection<java.util.Iterator<E>> objectIterators)
Creates a new instance of ObjectIteratorsIterator |
Method Summary | |
---|---|
E |
getCurrentObject()
Returns an instance of object returned by the last call to next(). |
boolean |
hasNext()
Returns true if the iteration has more elements. |
E |
next()
Returns the next element in the iteration. |
void |
remove()
Removes from the underlying collection the last element returned by the iterator (optional operation). |
Methods inherited from class messif.objects.util.AbstractObjectIterator |
---|
getCurrentObjectID, getMatchingObjects, getMatchingObjects, getMatchingObjects, getMatchingObjects, getObjectByAnyLocator, getObjectByData, getObjectByID, getObjectByLocator, getObjectByPosition, getRandomObject, getRandomObjects, nextObjectID, provideObjects |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final java.util.Queue<java.util.Iterator<? extends E extends AbstractObject>> iterators
protected java.util.Iterator<? extends E extends AbstractObject> currentIterator
protected E extends AbstractObject currentObject
Constructor Detail |
---|
public ObjectIteratorsIterator(java.util.Collection<java.util.Iterator<E>> objectIterators)
objectIterators
- The source iterators that will provide objectsMethod Detail |
---|
public E getCurrentObject() throws java.util.NoSuchElementException
getCurrentObject
in class AbstractObjectIterator<E extends AbstractObject>
java.util.NoSuchElementException
- Exception NoSuchElementException is thrown if next() has not been called yet.public boolean hasNext()
public E next() throws java.util.NoSuchElementException
java.util.NoSuchElementException
- iteration has no more elements.public void remove() throws java.lang.UnsupportedOperationException, java.lang.IllegalStateException
java.lang.UnsupportedOperationException
- if the remove
operation is not supported by this Iterator.
java.lang.IllegalStateException
- if the next method has not
yet been called, or the remove method has already
been called after the last call to the next
method.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |