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 DocumentIteratorbackendIteratorprotected LabelsSourcegenerator
-
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 LabelsSourcegetLabelsSource()booleanhasNext()booleanhasNextDocument()LabelledDocumentnext()LabelledDocumentnextDocument()protected StringreadStream(InputStream stream)voidremove()voidreset()voidshutdown()-
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:
hasNextDocumentin interfaceLabelAwareIterator
-
nextDocument
public LabelledDocument nextDocument()
- Specified by:
nextDocumentin interfaceLabelAwareIterator
-
reset
public void reset()
- Specified by:
resetin interfaceLabelAwareIterator
-
hasNext
public boolean hasNext()
- Specified by:
hasNextin interfaceIterator<LabelledDocument>
-
next
public LabelledDocument next()
- Specified by:
nextin interfaceIterator<LabelledDocument>
-
remove
public void remove()
- Specified by:
removein interfaceIterator<LabelledDocument>
-
getLabelsSource
public LabelsSource getLabelsSource()
- Specified by:
getLabelsSourcein interfaceLabelAwareIterator
-
shutdown
public void shutdown()
- Specified by:
shutdownin interfaceLabelAwareIterator
-
readStream
protected String readStream(InputStream stream) throws IOException
- Throws:
IOException
-
-