org.egothor.core
Interface BarrelReader

All Known Implementing Classes:
Document, MemoryBarrel, Merge, StreamReader, ThickBarrelIn, ThickFastIn

public interface BarrelReader

The BarrelReader interface that can read a Barrel structure. A BarrelReader returns just active (not removed) documents and all inverted lists without items related to removed documents. You must read/iterate over all documents first (getDocuments()), then you can read inverted lists (getILists()).

Author:
Leo Galambos

Method Summary
 void close()
          Close this BarrelReader.
 SequenceWithClose<DocumentData> getDocuments()
          Returns an enumeration of all active documents.
 SequenceWithClose<IListReader> getILists()
          Returns an enumeration of all inverted lists.
 long length()
          Returns number of active documents in this Barrel.
 void rewind()
          Restart this BarrelReader so that the documents can be read again.
 

Method Detail

getILists

SequenceWithClose<IListReader> getILists()
Returns an enumeration of all inverted lists. The objects of the enumeration are IListReaders. The readers must be initialized and the reader can represent a free list, that is, an IListReader that has no items can be returned.

Returns:
an Enumeration of IListReader objects

getDocuments

SequenceWithClose<DocumentData> getDocuments()
Returns an enumeration of all active documents. The objects of the enumeration are DocumentDatas. If the enumeration contains no elements, then the Barrel was destroyed completely.

Returns:
an Enumeration of DocMDocumentDataects

length

long length()
Returns number of active documents in this Barrel.

Returns:
the number of active documents

close

void close()
Close this BarrelReader.


rewind

void rewind()
            throws java.io.IOException,
                   java.lang.UnsupportedOperationException
Restart this BarrelReader so that the documents can be read again. The operation is not supported in all implementations.

Throws:
java.io.IOException
java.lang.UnsupportedOperationException