Class DocumentIteratorConverter
- java.lang.Object
-
- org.deeplearning4j.text.documentiterator.interoperability.DocumentIteratorConverter
-
- All Implemented Interfaces:
Iterator<LabelledDocument>
,LabelAwareIterator
public class DocumentIteratorConverter extends Object implements LabelAwareIterator
-
-
Field Summary
Fields Modifier and Type Field Description protected DocumentIterator
backendIterator
protected LabelsSource
generator
-
Constructor Summary
Constructors Constructor Description DocumentIteratorConverter(@NonNull DocumentIterator iterator, @NonNull LabelsSource generator)
DocumentIteratorConverter(@NonNull LabelAwareDocumentIterator iterator)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description LabelsSource
getLabelsSource()
boolean
hasNext()
boolean
hasNextDocument()
LabelledDocument
next()
LabelledDocument
nextDocument()
protected String
readStream(InputStream stream)
void
remove()
void
reset()
void
shutdown()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Iterator
forEachRemaining
-
-
-
-
Field Detail
-
backendIterator
protected DocumentIterator backendIterator
-
generator
protected LabelsSource generator
-
-
Constructor Detail
-
DocumentIteratorConverter
public DocumentIteratorConverter(@NonNull @NonNull LabelAwareDocumentIterator iterator)
-
DocumentIteratorConverter
public DocumentIteratorConverter(@NonNull @NonNull DocumentIterator iterator, @NonNull @NonNull LabelsSource generator)
-
-
Method Detail
-
hasNextDocument
public boolean hasNextDocument()
- Specified by:
hasNextDocument
in interfaceLabelAwareIterator
-
nextDocument
public LabelledDocument nextDocument()
- Specified by:
nextDocument
in interfaceLabelAwareIterator
-
reset
public void reset()
- Specified by:
reset
in interfaceLabelAwareIterator
-
hasNext
public boolean hasNext()
- Specified by:
hasNext
in interfaceIterator<LabelledDocument>
-
next
public LabelledDocument next()
- Specified by:
next
in interfaceIterator<LabelledDocument>
-
remove
public void remove()
- Specified by:
remove
in interfaceIterator<LabelledDocument>
-
getLabelsSource
public LabelsSource getLabelsSource()
- Specified by:
getLabelsSource
in interfaceLabelAwareIterator
-
shutdown
public void shutdown()
- Specified by:
shutdown
in interfaceLabelAwareIterator
-
readStream
protected String readStream(InputStream stream) throws IOException
- Throws:
IOException
-
-