Package it.unimi.di.big.mg4j.document
Class ReplicatedDocumentFactory.ReplicatedDocument
- java.lang.Object
-
- it.unimi.di.big.mg4j.document.AbstractDocument
-
- it.unimi.di.big.mg4j.document.ReplicatedDocumentFactory.ReplicatedDocument
-
- All Implemented Interfaces:
Document
,SafelyCloseable
,Closeable
,AutoCloseable
- Enclosing class:
- ReplicatedDocumentFactory
protected class ReplicatedDocumentFactory.ReplicatedDocument extends AbstractDocument
A document obtained by replication of the underlying-factory document.
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
ReplicatedDocument(InputStream rawContent, Reference2ObjectMap<Enum<?>,Object> metadata)
-
Method Summary
Modifier and Type Method Description Object
content(int field)
Returns the content of the given field.CharSequence
title()
The title of this document.String
toString()
CharSequence
uri()
A URI that is associated with this document.WordReader
wordReader(int field)
Returns a word reader for the givenDocumentFactory.FieldType.TEXT
field.-
Methods inherited from class it.unimi.di.big.mg4j.document.AbstractDocument
close, finalize
-
-
-
-
Constructor Detail
-
ReplicatedDocument
protected ReplicatedDocument(InputStream rawContent, Reference2ObjectMap<Enum<?>,Object> metadata) throws IOException
- Throws:
IOException
-
-
Method Detail
-
title
public CharSequence title()
Description copied from interface:Document
The title of this document.- Returns:
- the title to be used to refer to this document.
-
toString
public String toString()
- Overrides:
toString
in classAbstractDocument
-
uri
public CharSequence uri()
Description copied from interface:Document
A URI that is associated with this document.- Returns:
- the URI associated with this document, or
null
.
-
content
public Object content(int field) throws IOException
Description copied from interface:Document
Returns the content of the given field.- Parameters:
field
- the field index.- Returns:
- the field content; the actual type depends on the field type, as specified by the
DocumentFactory
that built this document. For example, the returned object is going to be aReader
if the field type isDocumentFactory.FieldType.TEXT
. - Throws:
IOException
-
wordReader
public WordReader wordReader(int field)
Description copied from interface:Document
Returns a word reader for the givenDocumentFactory.FieldType.TEXT
field.- Parameters:
field
- the field index.- Returns:
- a word reader object that should be used to break the given field.
-
-