gov.nist.nlpir.irf.modality
Class IndexingModalityUnit

java.lang.Object
  |
  +--gov.nist.nlpir.irf.modality.IndexingModalityUnit

public class IndexingModalityUnit
extends java.lang.Object
implements java.io.Serializable

Container for information relating an index, the feature (i.e., document field) on which it is built, the indexer used, etc.

Version:
$Revision: 1.2 $
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:
Index, IndexingModalities, InfoServer, Serialized Form

Field Summary
private  java.lang.String featureName
          Name of feature (i.e.
private  ProxyIndex index
          Index for this feature, i.e., document field
private  Indexer indexer
          An instance of the indexer for this IMU
private  java.lang.reflect.Field managedField
          A an instance of Field class for the document field being indexed.
private  boolean proxyRefsCounted
          Flag indicating refs to proxy indexes have been added to the table of in-memory proxies
(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
IndexingModalityUnit()
          Constructor: sets a default indexer
 
Method Summary
protected  void finalize()
          Performs clean-up just before being garbage collected
 java.lang.String getFeatureName()
          Gets the feature name of this modality unit.
 DataElem getFeatureValue(Document theDoc)
          Returns the data elements from 'fvals' corresponding to the featureName of this IMU.
 void getFirstInstances()
          Removes proxy duplicated during deserialization - replace with references to a single instance of the proxy.
 ProxyIndex getIndex()
          Gets index
 Indexer getIndexer()
          Gets indexer for this modality unit
 java.lang.String getIndexName()
          Gets index name
 void present()
          Prints representation of indexing modality unit to standard output showing featureName, indexer, and indexName.
 void save()
          If references from this object to its index have not been added to the table of in-memory proxies, then add the reference and mark it as added.
 void setFeatureName(java.lang.String name)
          Sets feature name
 void setIndex(ProxyIndex index)
          Sets index
 void setIndexer(Indexer ixr)
          Sets indexer for this modality unit
 java.lang.String toString()
          Returns string representation of indexing modality unit showing featureName, indexer, and indexName.
 boolean validate(DocumentIntrf r)
          Validates this supplied document against this modality unit
 
Methods inherited from class java.lang.Object
, clone, equals, 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

featureName

private java.lang.String featureName
Name of feature (i.e. document field) to be indexed

managedField

private transient java.lang.reflect.Field managedField
A an instance of Field class for the document field being indexed. not to be serialized with this IMU

index

private ProxyIndex index
Index for this feature, i.e., document field

indexer

private Indexer indexer
An instance of the indexer for this IMU

proxyRefsCounted

private boolean proxyRefsCounted
Flag indicating refs to proxy indexes have been added to the table of in-memory proxies
Constructor Detail

IndexingModalityUnit

public IndexingModalityUnit()
Constructor: sets a default indexer
Method Detail

getFeatureName

public final java.lang.String getFeatureName()
Gets the feature name of this modality unit.
Returns:
The current feature name.

setFeatureName

public final void setFeatureName(java.lang.String name)
Sets feature name
Parameters:
name - new feature name

getIndexer

public final Indexer getIndexer()
Gets indexer for this modality unit
Returns:
current indexer

setIndexer

public final void setIndexer(Indexer ixr)
Sets indexer for this modality unit
Parameters:
ixr - indexer

getIndex

public final ProxyIndex getIndex()
Gets index
Returns:
index

setIndex

public void setIndex(ProxyIndex index)
Sets index
Parameters:
new - index

getIndexName

public java.lang.String getIndexName()
Gets index name
Returns:
index name

getFeatureValue

public DataElem getFeatureValue(Document theDoc)
Returns the data elements from 'fvals' corresponding to the featureName of this IMU. Matches this Indexing Modality Unit's featureName against (Doc) featureNames in 'fnames'.
Parameters:
fnames - collection of feature names
fvals - collection of feature values
Returns:
The feature values corresponding to the feature name of this IMU.

save

public void save()
If references from this object to its index have not been added to the table of in-memory proxies, then add the reference and mark it as added.

present

public void present()
Prints representation of indexing modality unit to standard output showing featureName, indexer, and indexName.

toString

public java.lang.String toString()
Returns string representation of indexing modality unit showing featureName, indexer, and indexName.
Returns:
string representation of indexing modality unit.
Overrides:
toString in class java.lang.Object

validate

public boolean validate(DocumentIntrf r)
Validates this supplied document against this modality unit
Returns:
true always currently.

getFirstInstances

public void getFirstInstances()
Removes proxy duplicated during deserialization - replace with references to a single instance of the proxy.

finalize

protected void finalize()
Performs clean-up just before being garbage collected
Overrides:
finalize in class java.lang.Object