gov.nist.nlpir.irf.index
Class Index

java.lang.Object
  |
  +--gov.nist.nlpir.irf.InfoObj
        |
        +--gov.nist.nlpir.irf.index.Index
Direct Known Subclasses:
IdfIndex, KeyWordIndex

public abstract class Index
extends InfoObj
implements IndexIntrf, java.io.Serializable

Provides some basic index information and access to the index features. It also provides basic functionality for using the index. This class is aimed to extension in order to provide specific kinds of index: with Inversed Document Frequency, for example (see IdfIndex) or with Key word (see KeyWordIndex).

Version:
$Revision: 1.5 $
Author:
This software was produced by NIST, an agency of the U.S. government, and by statute is not subject to copyright in the United States. Recipients of this software assume all responsibilities associated with its operation, modification and maintenance.
See Also:
InfoObj, IdfIndex, KeyWordIndex, Serialized Form

Field Summary
protected  java.lang.String appliedIndexer
          the name of the indexer used to create this index
protected  IdxIntern IFs
          the index itself
protected  java.lang.String indexName
          the name of the index
(package private) static long serialVersionUID
          serial version universal id - put here so Java does not insert one which may change due to revisions and make it impossible to deserialize earlier versions of serialized objects
 
Constructor Summary
Index()
          No argument constructor only used by deserialization mechanism.
Index(java.lang.String name)
          Creates an Index with the supplied name and sets the appliedIndexer to "none".
 
Method Summary
 boolean addIndexingFeatures(java.util.Vector indexingFeatures, Indexer anIndexer)
          Add indexing features.
 boolean checkIndexer(Indexer anIndexer)
          Verifies that the same indexer is applied consistantly.
 void clear()
          Clears the index and its features.
 java.util.Enumeration getFeatures()
          Returns the features for which indexing features have been stored.
 java.lang.String getName()
          Gets the index name.
 java.util.Enumeration getSources()
          Returns the sources for which indexing features have been stored.
 void present()
          Presents the status of the index and its features.
 void presentStatistics()
          Presents the status of the index and its feature statistics.
 java.util.Vector retrieve(QueryModalityUnit qm, java.util.Vector setIF)
          Executes a search and retrieves documents.
 void showStatistics(int depth, int maxLengthIf3)
          statistics about the index.
 java.lang.String toString()
          Gives a String Representaiton of the Index.
 void update()
          Updates the index and its features.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

serialVersionUID

static final long serialVersionUID
serial version universal id - put here so Java does not insert one which may change due to revisions and make it impossible to deserialize earlier versions of serialized objects

indexName

protected java.lang.String indexName
the name of the index

appliedIndexer

protected java.lang.String appliedIndexer
the name of the indexer used to create this index

IFs

protected IdxIntern IFs
the index itself
Constructor Detail

Index

public Index(java.lang.String name)
Creates an Index with the supplied name and sets the appliedIndexer to "none". May be called by subclasses. In every case, these subclasses will have to set the IdxIntern in the Index.
Parameters:
name - index name.

Index

public Index()
No argument constructor only used by deserialization mechanism.
Method Detail

getName

public java.lang.String getName()
Gets the index name.
Specified by:
getName in interface IndexIntrf
Returns:
The index name.

getFeatures

public java.util.Enumeration getFeatures()
Returns the features for which indexing features have been stored.
Specified by:
getFeatures in interface IndexIntrf
Returns:
The Enumeration of Objects (should be DeIntern) used as features in this Index

getSources

public java.util.Enumeration getSources()
Returns the sources for which indexing features have been stored.
Specified by:
getSources in interface IndexIntrf
Returns:
The Enumeration of Objects (should be IoAddrIntern) used as sources in this Index

update

public void update()
Updates the index and its features.
Specified by:
update in interface IndexIntrf

clear

public void clear()
Clears the index and its features.
Specified by:
clear in interface IndexIntrf

retrieve

public java.util.Vector retrieve(QueryModalityUnit qm,
                                 java.util.Vector setIF)
Executes a search and retrieves documents.
Specified by:
retrieve in interface IndexIntrf
Parameters:
qm - Query Modality Unit
setIF - Vector of indexing features
Returns:
Results or null if submitted to the wrong index.

present

public void present()
Presents the status of the index and its features.
Specified by:
present in interface IndexIntrf

presentStatistics

public void presentStatistics()
Presents the status of the index and its feature statistics.
Specified by:
presentStatistics in interface IndexIntrf

toString

public java.lang.String toString()
Gives a String Representaiton of the Index.
Specified by:
toString in interface IndexIntrf
Overrides:
toString in class java.lang.Object

checkIndexer

public boolean checkIndexer(Indexer anIndexer)
Verifies that the same indexer is applied consistantly.
Specified by:
checkIndexer in interface IndexIntrf
Parameters:
an_Indexer - an indexer
Returns:
true if the Index is well applied, false otherwise.

addIndexingFeatures

public boolean addIndexingFeatures(java.util.Vector indexingFeatures,
                                   Indexer anIndexer)
Add indexing features.
Specified by:
addIndexingFeatures in interface IndexIntrf
Parameters:
indexingFeatures - Vector of indexing features.
anIndexer - an indexer.
Returns:
true if the Indexer exists and is correct,
false otherwise

showStatistics

public void showStatistics(int depth,
                           int maxLengthIf3)
statistics about the index.
Specified by:
showStatistics in interface IndexIntrf
Parameters:
deep - depth of the statistics in the intern index
maxLengthIf3 - maximum number of characters printed.
See Also:
PersistentDualKeyContainer.showStatistics(int, int)