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 |
hasNext() |
boolean |
hasNextDocument()
This method checks, if there's more LabelledDocuments in underlying iterator
|
LabelledDocument |
next() |
LabelledDocument |
nextDocument()
This method returns next LabelledDocument from underlying iterator
|
void |
remove() |
void |
reset()
This methods resets LabelAwareIterator by creating new Iterator from Iterable internally
|
void |
shutdown() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEachRemaining
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 LabelAwareIterator
public LabelledDocument nextDocument()
nextDocument
in interface LabelAwareIterator
public boolean hasNext()
hasNext
in interface Iterator<LabelledDocument>
public LabelledDocument next()
next
in interface Iterator<LabelledDocument>
public void remove()
remove
in interface Iterator<LabelledDocument>
public void shutdown()
shutdown
in interface LabelAwareIterator
public void reset()
reset
in interface LabelAwareIterator
public LabelsSource getLabelsSource()
getLabelsSource
in interface LabelAwareIterator
Copyright © 2017. All rights reserved.