org.cdlib.xtf.textIndexer
Class IndexSource

Object
  extended by IndexSource
Direct Known Subclasses:
MARCIndexSource, XMLIndexSource

public abstract class IndexSource
extends Object

Represents a single source of data for an XTF index. It may contain one or more IndexRecords, including its key and prefilters to apply to the records.


Constructor Summary
IndexSource()
           
 
Method Summary
abstract  Templates displayStyle()
          Stylesheet from which to gather XSLT key definitions to be computed and cached on disk.
abstract  String key()
          Obtain a unique key for this input file
abstract  IndexRecord nextRecord()
          Obtain the next record from the file, or null if no more.
abstract  File path()
          Obtain the path to the file (or null if it's not a local file)
abstract  Templates[] preFilters()
          Obtain set of prefilters to be run, serially in order, on each input record.
abstract  long totalSize()
          Obtain the total size of the source file (used to calculate overall % done).
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IndexSource

public IndexSource()
Method Detail

path

public abstract File path()
Obtain the path to the file (or null if it's not a local file)


key

public abstract String key()
Obtain a unique key for this input file


preFilters

public abstract Templates[] preFilters()
Obtain set of prefilters to be run, serially in order, on each input record.

Returns:
Prefilter stylesheet(s) to run, or null to for none.

displayStyle

public abstract Templates displayStyle()
Stylesheet from which to gather XSLT key definitions to be computed and cached on disk. Typically, one would use the actual display stylesheet for this purpose, guaranteeing that all of its keys will be pre-cached.

Background: stylesheet processing can be optimized by using XSLT 'keys', which are declared with an <xsl:key> tag. The first time a key is used in a given source document, it must be calculated and its values stored on disk. The text indexer can optionally pre-compute the keys so they need not be calculated later during the display process.


totalSize

public abstract long totalSize()
Obtain the total size of the source file (used to calculate overall % done). If you don't know, return 1.


nextRecord

public abstract IndexRecord nextRecord()
                                throws SAXException,
                                       IOException
Obtain the next record from the file, or null if no more.

Throws:
SAXException
IOException