Salt  3.4.2
A powerful, tagset-independent and theory-neutral meta model and API for storing, manipulating, and representing nearly all types of linguistic data .
org.corpus_tools.salt.index.IndexMgr Interface Reference

The index manager provides a mechanism to register indexes. More...

Inherits Serializable.

Inherited by org.corpus_tools.salt.index.IndexMgrImpl.

Public Member Functions

public< K, V > void createIndex (String indexId, Class< K > keyType, Class< V > valueType)
 Creates a new index which could be accessed via the passed identifier. More...
 
public< K, V > void createIndex (String indexId, Class< K > keyType, Class< V > valueType, int expectedKeys, int expectedValuesPerKey)
 Creates a new index which could be accessed via the passed identifier. More...
 
boolean containsIndex (String indexId)
 Checks if an index with the passed identifier is registered. More...
 
boolean removeIndex (String indexId)
 Removes the index with the passed identifier. More...
 
void clearIndex (String indexId)
 Removes all entries contained in the index with the passed identifier. More...
 
void removeAll ()
 Removes all index from the index manager.
 
public< K, V > boolean put (String indexId, K key, V value)
 Adds a new value to the index having the passed identifier under the passed key. More...
 
public< K, V > boolean putAll (String indexId, K key, Collection< V > values)
 Adds a collection of values to the index having the passed identifier under the passed key. More...
 
public< K, V > V get (String indexId, K key)
 Returns the value corresponding to the passed key, which is contained in the index with the passed identifier. More...
 
public< K, V > List< V > getAll (String indexId, K key)
 Returns the set of values corresponding to the passed key, which is contained in the index with the passed identifier. More...
 
public< K > boolean remove (String indexId, K key)
 Removes the value or collection of values corresponding to the passed key contained in the index having the passed identifier. More...
 
public< K, V > boolean remove (String indexId, K key, V value)
 Removes the passed value corresponding to the passed key contained in the index having the passed identifier. More...
 
public< K > boolean containsKey (String indexId, K key)
 Returns whether the index having the passed identifier contains the passed key. More...
 
public< V > boolean removeValue (V value)
 Removes the passed value from all registered indexes. More...
 
public< V > boolean removeValue (String indexId, V value)
 Removes the passed value from the indexes having the passed identifier. More...
 

Detailed Description

The index manager provides a mechanism to register indexes.

An index relates a set of nodes, relations or layers with an identifier. Each index is also identified by an identifier, which is also used to access its elements.
A new index could be created via addIndex(String, Class, Class).

Author
florian

Member Function Documentation

◆ clearIndex()

void org.corpus_tools.salt.index.IndexMgr.clearIndex ( String  indexId)

Removes all entries contained in the index with the passed identifier.

Parameters
indexIdidentifier of the index

Implemented in org.corpus_tools.salt.index.IndexMgrImpl.

◆ containsIndex()

boolean org.corpus_tools.salt.index.IndexMgr.containsIndex ( String  indexId)

Checks if an index with the passed identifier is registered.

Parameters
indexIdidentifier of the index
Returns
true if an index with the passed identifier exists, false otherwise

Implemented in org.corpus_tools.salt.index.IndexMgrImpl.

◆ containsKey()

public<K> boolean org.corpus_tools.salt.index.IndexMgr.containsKey ( String  indexId,
key 
)

Returns whether the index having the passed identifier contains the passed key.

Parameters
indexIdidentifier of the index
keykey to be searched for
Returns
true when the index contains such a key
Parameters
<K>

◆ createIndex() [1/2]

public<K, V> void org.corpus_tools.salt.index.IndexMgr.createIndex ( String  indexId,
Class< K >  keyType,
Class< V >  valueType 
)

Creates a new index which could be accessed via the passed identifier.

The index can handle keys and values of the passed types.

Parameters
indexIdidentifier to access the index or its elements
keyTypetype of the keys in the index
valueTypetype of the values in the index
<K>
<V>

◆ createIndex() [2/2]

public<K, V> void org.corpus_tools.salt.index.IndexMgr.createIndex ( String  indexId,
Class< K >  keyType,
Class< V >  valueType,
int  expectedKeys,
int  expectedValuesPerKey 
)

Creates a new index which could be accessed via the passed identifier.

The index can handle keys and values of the passed types.

Parameters
indexIdidentifier to access the index or its elements
keyTypetype of the keys in the index
valueTypetype of the values in the index
expectedKeysnumber of expected keys of the index, this parameter is used for initialization optimization. -1 means no expected size
expectedValuesPerKeynumber of expected values per key of the index, this parameter is used for initialization optimization.
<K>
<V>

◆ get()

public<K, V> V org.corpus_tools.salt.index.IndexMgr.get ( String  indexId,
key 
)

Returns the value corresponding to the passed key, which is contained in the index with the passed identifier.

Parameters
indexIdidentifier of the index
keycorresponding key to the returned value
Returns
value matching the passed key
Parameters
<K>
<V>

◆ getAll()

public<K, V> List<V> org.corpus_tools.salt.index.IndexMgr.getAll ( String  indexId,
key 
)

Returns the set of values corresponding to the passed key, which is contained in the index with the passed identifier.

Parameters
indexIdidentifier of the index
keycorresponding key to the returned set of values
Returns
set of values matching the passed key
Parameters
<K>
<V>

◆ put()

public<K, V> boolean org.corpus_tools.salt.index.IndexMgr.put ( String  indexId,
key,
value 
)

Adds a new value to the index having the passed identifier under the passed key.

If no such index exists, nothing is added.

Parameters
indexIdidentifier of the index
keythe key to access the passed value
valuethe value to be added to the index
Returns
true, if the entry was successfully added, false otherwise
Parameters
<K>
<V>

◆ putAll()

public<K, V> boolean org.corpus_tools.salt.index.IndexMgr.putAll ( String  indexId,
key,
Collection< V >  values 
)

Adds a collection of values to the index having the passed identifier under the passed key.

If no such index exists, nothing is added.

Parameters
indexIdidentifier of the index
keythe key to access the passed value
valuesthe values to be added to the index
Returns
true, if the values were added successfully, false otherwise
Parameters
<K>
<V>

◆ remove() [1/2]

public<K> boolean org.corpus_tools.salt.index.IndexMgr.remove ( String  indexId,
key 
)

Removes the value or collection of values corresponding to the passed key contained in the index having the passed identifier.

To remove a single value in a set of values use method remove(String, Object, Object).

Parameters
indexIdidentifier of the index
keykey corresponding to the value or values to be removed
Returns
true if the value or set of values were removed successfully, false otherwise
Parameters
<K>

◆ remove() [2/2]

public<K, V> boolean org.corpus_tools.salt.index.IndexMgr.remove ( String  indexId,
key,
value 
)

Removes the passed value corresponding to the passed key contained in the index having the passed identifier.

Parameters
indexIdidentifier of the index
keykey corresponding to the value to be removed
value
Returns
true if the value were removed successfully, false otherwise
Parameters
<K>
<V>

◆ removeIndex()

boolean org.corpus_tools.salt.index.IndexMgr.removeIndex ( String  indexId)

Removes the index with the passed identifier.

Parameters
indexIdidentifier of the index
Returns
true if the identifier could be removed successfully, false otherwise

Implemented in org.corpus_tools.salt.index.IndexMgrImpl.

◆ removeValue() [1/2]

public<V> boolean org.corpus_tools.salt.index.IndexMgr.removeValue ( String  indexId,
value 
)

Removes the passed value from the indexes having the passed identifier.

Parameters
indexId
valuethe value to be removed
Returns
true, if the value was removed successfully
Parameters
<V>

◆ removeValue() [2/2]

public<V> boolean org.corpus_tools.salt.index.IndexMgr.removeValue ( value)

Removes the passed value from all registered indexes.

Parameters
valuethe value to be removed
Returns
true, if the value was removed successfully
Parameters
<V>