public class SearchObjectAggregator extends SearchObjectCursor implements java.util.Iterator<SearchObject>
An implementation of Iterator<SearchObject> that aggregates multiple SearchObjectCursor objects. This class deals with the idea that a SearchObjectCursor will return either a SearchObject directly or in some cases, another SearchObjectCursor.
The SearchObjectAggregator can optionally be given a TaskProgressListener
, which it will monitor for
cancellation, so that the individual cursors don't need to worry about task cancellation.
Constructor and Description |
---|
SearchObjectAggregator() |
SearchObjectAggregator(TaskProgressListener progress) |
SearchObjectAggregator(TaskProgressListener progress,
SearchObjectCursor... cursors) |
Modifier and Type | Method and Description |
---|---|
void |
add(SearchObject object) |
void |
add(SearchObjectCursor cursor) |
boolean |
hasNext() |
SearchObject |
next()
Gets the next search object, which might be a SearchObject or a SearchObjectCursor.
|
protected void |
onFinished()
Override this to be notified when this iterator has been exhausted
|
void |
remove() |
of
public SearchObjectAggregator()
public SearchObjectAggregator(TaskProgressListener progress)
public SearchObjectAggregator(TaskProgressListener progress, SearchObjectCursor... cursors)
public void add(SearchObject object)
public void add(SearchObjectCursor cursor)
protected void onFinished()
public boolean hasNext()
hasNext
in interface java.util.Iterator<SearchObject>
public SearchObject next()
SearchObjectCursor
next
in interface java.util.Iterator<SearchObject>
next
in class SearchObjectCursor
public void remove()
remove
in interface java.util.Iterator<SearchObject>