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 .
|
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... | |
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).
void org.corpus_tools.salt.index.IndexMgr.clearIndex | ( | String | indexId | ) |
Removes all entries contained in the index with the passed identifier.
indexId | identifier of the index |
Implemented in org.corpus_tools.salt.index.IndexMgrImpl.
boolean org.corpus_tools.salt.index.IndexMgr.containsIndex | ( | String | indexId | ) |
Checks if an index with the passed identifier is registered.
indexId | identifier of the index |
Implemented in org.corpus_tools.salt.index.IndexMgrImpl.
public<K> boolean org.corpus_tools.salt.index.IndexMgr.containsKey | ( | String | indexId, |
K | key | ||
) |
Returns whether the index having the passed identifier contains the passed key.
indexId | identifier of the index |
key | key to be searched for |
<K> |
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.
indexId | identifier to access the index or its elements |
keyType | type of the keys in the index |
valueType | type of the values in the index |
<K> | |
<V> |
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.
indexId | identifier to access the index or its elements |
keyType | type of the keys in the index |
valueType | type of the values in the index |
expectedKeys | number of expected keys of the index, this parameter is used for initialization optimization. -1 means no expected size |
expectedValuesPerKey | number of expected values per key of the index, this parameter is used for initialization optimization. |
<K> | |
<V> |
public<K, V> V org.corpus_tools.salt.index.IndexMgr.get | ( | String | indexId, |
K | key | ||
) |
Returns the value corresponding to the passed key, which is contained in the index with the passed identifier.
indexId | identifier of the index |
key | corresponding key to the returned value |
<K> | |
<V> |
public<K, V> List<V> org.corpus_tools.salt.index.IndexMgr.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.
indexId | identifier of the index |
key | corresponding key to the returned set of values |
<K> | |
<V> |
public<K, V> boolean org.corpus_tools.salt.index.IndexMgr.put | ( | String | indexId, |
K | key, | ||
V | value | ||
) |
Adds a new value to the index having the passed identifier under the passed key.
If no such index exists, nothing is added.
indexId | identifier of the index |
key | the key to access the passed value |
value | the value to be added to the index |
<K> | |
<V> |
public<K, V> boolean org.corpus_tools.salt.index.IndexMgr.putAll | ( | String | indexId, |
K | 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.
indexId | identifier of the index |
key | the key to access the passed value |
values | the values to be added to the index |
<K> | |
<V> |
public<K> boolean org.corpus_tools.salt.index.IndexMgr.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.
To remove a single value in a set of values use method remove(String, Object, Object).
indexId | identifier of the index |
key | key corresponding to the value or values to be removed |
<K> |
public<K, V> boolean org.corpus_tools.salt.index.IndexMgr.remove | ( | String | indexId, |
K | key, | ||
V | value | ||
) |
Removes the passed value corresponding to the passed key contained in the index having the passed identifier.
indexId | identifier of the index |
key | key corresponding to the value to be removed |
value |
<K> | |
<V> |
boolean org.corpus_tools.salt.index.IndexMgr.removeIndex | ( | String | indexId | ) |
Removes the index with the passed identifier.
indexId | identifier of the index |
Implemented in org.corpus_tools.salt.index.IndexMgrImpl.
public<V> boolean org.corpus_tools.salt.index.IndexMgr.removeValue | ( | String | indexId, |
V | value | ||
) |
Removes the passed value from the indexes having the passed identifier.
indexId | |
value | the value to be removed |
<V> |
public<V> boolean org.corpus_tools.salt.index.IndexMgr.removeValue | ( | V | value | ) |
Removes the passed value from all registered indexes.
value | the value to be removed |
<V> |