|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object it.unimi.di.mg4j.document.AbstractDocumentSequence it.unimi.di.mg4j.document.ConcatenatedDocumentSequence
public class ConcatenatedDocumentSequence
A document sequence exhibiting a list of underlying document sequences, called segments, as a single sequence. The underlying sequences are (virtually) concatenated—that is, the first document of the second sequence is renumbered to the size of the first sequence, and so on. All underlying sequences must use the same factory class.
Constructor Summary | |
---|---|
|
ConcatenatedDocumentSequence(DocumentSequence... sequence)
Creates a new concatenated document sequence using giving component sequences. |
|
ConcatenatedDocumentSequence(String... sequenceName)
Creates a new concatenated document sequence using giving serialised component sequences. |
protected |
ConcatenatedDocumentSequence(String[] sequenceName,
DocumentSequence[] sequence)
Creates a new concatenated document sequence using giving component sequences. |
Method Summary | |
---|---|
void |
close()
Closes this document sequence, releasing all resources. |
DocumentFactory |
factory()
Returns the factory used by this sequence. |
void |
filename(CharSequence filename)
Does nothing. |
DocumentIterator |
iterator()
Returns an iterator over the sequence of documents. |
Methods inherited from class it.unimi.di.mg4j.document.AbstractDocumentSequence |
---|
finalize, load |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ConcatenatedDocumentSequence(DocumentSequence... sequence) throws IOException
sequence
- a list of component sequences.
IOException
public ConcatenatedDocumentSequence(String... sequenceName) throws IOException
sequenceName
- a list of serialised component sequences.
IOException
protected ConcatenatedDocumentSequence(String[] sequenceName, DocumentSequence[] sequence) throws IOException
sequenceName
- sequence
- a list of component sequences.
IOException
Method Detail |
---|
public void filename(CharSequence filename)
AbstractDocumentSequence
filename
in interface DocumentSequence
filename
in class AbstractDocumentSequence
filename
- the filename of this document sequence.public DocumentFactory factory()
DocumentSequence
Every document sequence is based on a document factory that transforms raw bytes into a sequence of characters. The factory contains useful information such as the number of fields.
public void close() throws IOException
DocumentSequence
You should always call this method after having finished with this document sequence.
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 DocumentSequence
close
in interface Closeable
close
in class AbstractDocumentSequence
IOException
public DocumentIterator iterator() throws IOException
DocumentSequence
Warning: this method can be safely called just one time. For instance, implementations based on standard input will usually throw an exception if this method is called twice.
Implementations may decide to override this restriction
(in particular, if they implement DocumentCollection
). Usually,
however, it is not possible to obtain two iterators at the
same time on a collection.
IOException
DocumentCollection
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |