T
- the class of the iterated objectspublic class SearchAbstractObjectDualIterator<T extends LocalAbstractObject> extends SearchAbstractObjectIterator<T>
Search
and AbstractObjectIterator
.
This iterator will go always one object forward then one object backward
from the initial object of the search.hasNext, search
Constructor and Description |
---|
SearchAbstractObjectDualIterator(Search<T> search)
Creates a new instance of SearchAbstractObjectIterator for the specified
Search instance. |
SearchAbstractObjectDualIterator(Search<T> search,
int limit)
Creates a new instance of SearchAbstractObjectIterator for the specified
Search instance. |
Modifier and Type | Method and Description |
---|---|
T |
getCurrentObject()
Returns an object returned by the last call to
Iterator.next() . |
boolean |
hasNext() |
getCount, getLimit, getObjectByAnyLocator, getRandomObjects, isLimitReached, next, remove
emptyIterator, getIterator, getMatchingObjects, getMatchingObjects, getMatchingObjects, getMatchingObjects, getObjectByData, getObjectByLocator, getObjectByLocator, getObjectByLocatorRegexp, getObjectByPosition, getRandomObject, provideObjects, singleton, skip
public SearchAbstractObjectDualIterator(Search<T> search, int limit) throws java.lang.CloneNotSupportedException
Search
instance.search
- the Search
instance to wrap by this iteratorlimit
- limit the number of iterations (zero means unlimited)java.lang.CloneNotSupportedException
- if there was an error cloning the searchpublic SearchAbstractObjectDualIterator(Search<T> search) throws java.lang.CloneNotSupportedException
Search
instance.
Number of iterations is not limited.search
- the Search
instance to wrap by this iteratorjava.lang.CloneNotSupportedException
- if there was an error cloning the searchpublic T getCurrentObject()
AbstractObjectIterator
Iterator.next()
.getCurrentObject
in class SearchAbstractObjectIterator<T extends LocalAbstractObject>
Iterator.next()
public boolean hasNext()
hasNext
in interface java.util.Iterator<T extends LocalAbstractObject>
hasNext
in class SearchAbstractObjectIterator<T extends LocalAbstractObject>