iglu.ir
Class PagedDocumentSet

java.lang.Object
  |
  +--iglu.ir.PagedDocumentSet
All Implemented Interfaces:
DocumentSet, EditableDocumentSet, java.io.Serializable

public class PagedDocumentSet
extends java.lang.Object
implements EditableDocumentSet, java.io.Serializable

A document set backed by an FileObjectPager. This supports having very large document sets transparently loaded. By default it uses the RAMObjectPager, eliminating any advantages over the DefaultDocumentSet. Supply your own FileObjectPager.

Author:
Travis Bauer
See Also:
Serialized Form

Field Summary
(package private)  PagedLinkedList docs
          The documents
(package private)  DocumentFilter[] filters
          The filters
(package private)  PagedLinkedList metaData
          The meta data
 
Constructor Summary
PagedDocumentSet()
          Create a new PagedDocumentSet using the RAMObjectPager.
PagedDocumentSet(ObjectPager pager)
          Create a new PagedDocumentSet using the given pager.
 
Method Summary
 int addDoc(Document d)
          Add a document with no meta data
 int addDoc(Document d, java.lang.Object metaData)
          Add a document and associated meta data
 Document getDoc(int docNum)
          Retrieve the indicated document
 java.lang.Object getDocMeta(int docNum)
          Get the meta data for the indicated document
 java.util.Iterator iterator()
          Get an iterator over the document set
 void setFilters(DocumentFilter[] filters)
          A set of filters which getDoc must apply when returning documents
 void setPager(ObjectPager pager)
          Start using the given pager.
 int size()
          Return the number of documents in this document set
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

docs

PagedLinkedList docs
The documents


metaData

PagedLinkedList metaData
The meta data


filters

DocumentFilter[] filters
The filters

Constructor Detail

PagedDocumentSet

public PagedDocumentSet()
Create a new PagedDocumentSet using the RAMObjectPager. Provided for convienence. It is better to supply your own pager.


PagedDocumentSet

public PagedDocumentSet(ObjectPager pager)
Create a new PagedDocumentSet using the given pager.

Method Detail

setFilters

public void setFilters(DocumentFilter[] filters)
Description copied from interface: DocumentSet
A set of filters which getDoc must apply when returning documents

Specified by:
setFilters in interface DocumentSet

setPager

public void setPager(ObjectPager pager)
Start using the given pager. Data will be copied from the old pager to the new one.


addDoc

public int addDoc(Document d)
Add a document with no meta data

Specified by:
addDoc in interface EditableDocumentSet

addDoc

public int addDoc(Document d,
                  java.lang.Object metaData)
Add a document and associated meta data

Specified by:
addDoc in interface EditableDocumentSet

getDoc

public Document getDoc(int docNum)
Retrieve the indicated document

Specified by:
getDoc in interface DocumentSet

getDocMeta

public java.lang.Object getDocMeta(int docNum)
Get the meta data for the indicated document

Specified by:
getDocMeta in interface DocumentSet

iterator

public java.util.Iterator iterator()
Get an iterator over the document set

Specified by:
iterator in interface DocumentSet

size

public int size()
Return the number of documents in this document set

Specified by:
size in interface DocumentSet