|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object it.unimi.di.mg4j.document.AbstractDocument it.unimi.di.mg4j.document.CompositeDocumentFactory.CompositeDocument
protected class CompositeDocumentFactory.CompositeDocument
A document obtained by composition of documents of underyling factories.
Constructor Summary | |
---|---|
protected |
CompositeDocumentFactory.CompositeDocument(Reference2ObjectMap<Enum<?>,Object> metadata,
InputStream rawContent)
|
Method Summary | |
---|---|
void |
close()
Closes this document, releasing all resources. |
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 given DocumentFactory.FieldType.TEXT field. |
Methods inherited from class it.unimi.di.mg4j.document.AbstractDocument |
---|
finalize |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
protected CompositeDocumentFactory.CompositeDocument(Reference2ObjectMap<Enum<?>,Object> metadata, InputStream rawContent) throws IOException
IOException
Method Detail |
---|
public CharSequence title()
Document
null
.public String toString()
toString
in class AbstractDocument
public CharSequence uri()
Document
null
.public Object content(int field) throws IOException
Document
field
- the field index.
DocumentFactory
that
built this document. For example, the returned object is going to be a Reader
if the field type is
DocumentFactory.FieldType.TEXT
.
IOException
public WordReader wordReader(int field)
Document
DocumentFactory.FieldType.TEXT
field.
field
- the field index.
public void close() throws IOException
Document
You should always call this method after manipulating a document. Implementations
are invited to call this method in a finaliser as a safety net (even better,
implement SafelyCloseable
), but since there
is no guarantee as to when finalisers are invoked, you should not depend on this behaviour.
close
in interface Document
close
in interface Closeable
close
in class AbstractDocument
IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |