Package org.apache.jackrabbit.core.util
Interface StringIndex
-
- All Known Implementing Classes:
DbNameIndex
,FileBasedIndex
,HashMapIndex
,NamespaceRegistryImpl
,NGKDbNameIndex
,PostgreSQLNameIndex
public interface StringIndex
A persistent two-way mapping between strings and index integers. The index may or may not be sequential.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description String
indexToString(int idx)
Returns the string for a given index.int
stringToIndex(String string)
Returns the index for a given string.
-
-
-
Method Detail
-
stringToIndex
int stringToIndex(String string) throws IllegalArgumentException
Returns the index for a given string. If the given string is not already indexed, the implementation can either automatically index it or throw an exception.- Parameters:
string
- the indexed (or to be indexed) string- Returns:
- index of the string
- Throws:
IllegalArgumentException
- if the string is not (and can not be) indexed
-
indexToString
String indexToString(int idx) throws IllegalArgumentException
Returns the string for a given index.- Parameters:
idx
- index of a string- Returns:
- the indexed string
- Throws:
IllegalArgumentException
- if the indexed string does not exist
-
-