org.biojava.bio.program.tagvalue
Class Index2Model

java.lang.Object
  extended byorg.biojava.bio.program.tagvalue.Index2Model

public class Index2Model
extends java.lang.Object


Constructor Summary
Index2Model()
           
 
Method Summary
 void addKeyPath(java.lang.String keyName, java.lang.Object[] path)
           Add a key and a path to that key in the tag-value hierachy.
 java.lang.Object[] getKeyPath(java.lang.String keyName)
           
 java.util.Set getKeys()
           
 java.lang.String getPrimaryKeyName()
          Retrieve the tag currently used as primary key.
 void removeKeyPath(java.lang.String keyName)
          Remove a key.
 void setPrimaryKeyName(java.lang.String primaryKeyName)
           Set the tag to use as a primary key in the index.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Index2Model

public Index2Model()
Method Detail

setPrimaryKeyName

public void setPrimaryKeyName(java.lang.String primaryKeyName)

Set the tag to use as a primary key in the index.

Whenever a value for the primary key tag is seen, this is passed to the indexer as the primary key for indexing.

Primary keys must be unique between entries, and each entry must provide exactly one primary key value.

Parameters:
primaryKeyName - the tag to use as primary key

getPrimaryKeyName

public java.lang.String getPrimaryKeyName()
Retrieve the tag currently used as primary key.

Returns:
a String representing the primary key name

addKeyPath

public void addKeyPath(java.lang.String keyName,
                       java.lang.Object[] path)

Add a key and a path to that key in the tag-value hierachy.

Secondary keys are potentialy non-unique properties of the entries being indexed. Multiple records can use the same secondary key values, and a single record can have multiple values for a secondary key. However, the primary key must be unique.

Parameters:
keyName - the name of the secondary key to add
path - the names of each tag to follow to reach the value of the key

removeKeyPath

public void removeKeyPath(java.lang.String keyName)
Remove a key.

Parameters:
keyName - the name of the key to remove

getKeyPath

public java.lang.Object[] getKeyPath(java.lang.String keyName)

getKeys

public java.util.Set getKeys()