public class SimpleLabelAwareIterator extends Object implements LabelAwareIterator
| Modifier and Type | Field and Description |
|---|---|
protected Iterator<LabelledDocument> |
currentIterator |
protected LabelsSource |
labels |
protected Iterable<LabelledDocument> |
underlyingIterable |
| Constructor and Description |
|---|
SimpleLabelAwareIterator(Iterable<LabelledDocument> iterable)
Builds LabelAwareIterator instance using Iterable object
|
SimpleLabelAwareIterator(Iterator<LabelledDocument> iterator)
Builds LabelAwareIterator instance using Iterator object
PLEASE NOTE: If instance is built using Iterator object, reset() method becomes unavailable
|
| Modifier and Type | Method and Description |
|---|---|
LabelsSource |
getLabelsSource()
This method returns LabelsSource instance, containing all labels derived from this iterator
|
boolean |
hasNextDocument()
This method checks, if there's more LabelledDocuments in underlying iterator
|
LabelledDocument |
nextDocument()
This method returns next LabelledDocument from underlying iterator
|
void |
reset()
This methods resets LabelAwareIterator by creating new Iterator from Iterable internally
|
protected transient Iterable<LabelledDocument> underlyingIterable
protected transient Iterator<LabelledDocument> currentIterator
protected LabelsSource labels
public SimpleLabelAwareIterator(@NonNull
Iterable<LabelledDocument> iterable)
iterable - public SimpleLabelAwareIterator(@NonNull
Iterator<LabelledDocument> iterator)
iterator - public boolean hasNextDocument()
hasNextDocument in interface LabelAwareIteratorpublic LabelledDocument nextDocument()
nextDocument in interface LabelAwareIteratorpublic void reset()
reset in interface LabelAwareIteratorpublic LabelsSource getLabelsSource()
getLabelsSource in interface LabelAwareIteratorCopyright © 2016. All Rights Reserved.