E
- the class of the iterated objectspublic class ObjectProvidersIterator<E extends AbstractObject> extends AbstractObjectIterator<E>
Modifier and Type | Field and Description |
---|---|
protected AbstractObjectIterator<? extends E> |
currentIterator
Iterator from current provider
|
protected E |
currentObject
Stored instance of object returned by the last call to next()
|
protected java.util.Queue<ObjectProvider<? extends E>> |
providers
Queue of providers that are waiting to be scanned
|
Constructor and Description |
---|
ObjectProvidersIterator(java.util.Collection<ObjectProvider<? extends E>> objectProviders)
Creates a new instance of ObjectProvidersIterator
|
Modifier and Type | Method and Description |
---|---|
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).
|
emptyIterator, getIterator, getMatchingObjects, getMatchingObjects, getMatchingObjects, getMatchingObjects, getObjectByAnyLocator, getObjectByData, getObjectByLocator, getObjectByLocator, getObjectByLocatorRegexp, getObjectByPosition, getRandomObject, getRandomObjects, provideObjects, singleton, skip
protected final java.util.Queue<ObjectProvider<? extends E extends AbstractObject>> providers
protected AbstractObjectIterator<? extends E extends AbstractObject> currentIterator
protected E extends AbstractObject currentObject
public ObjectProvidersIterator(java.util.Collection<ObjectProvider<? extends E>> objectProviders)
objectProviders
- The source ObjectProviders that will provide objectspublic 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.