public class GenericIndex<K,O,ID> extends Object implements Index<K,O,ID>
Modifier and Type | Field and Description |
---|---|
protected String |
attributeId |
protected int |
cacheSize |
protected File |
wkDirPath |
DEFAULT_INDEX_CACHE_SIZE
Constructor and Description |
---|
GenericIndex(String attributeId,
int cacheSize)
Creates a new instance of GenericIndex.
|
GenericIndex(String attributeId,
int cacheSize,
File wkDirPath)
Creates a new instance of GenericIndex.
|
Modifier and Type | Method and Description |
---|---|
void |
add(K attrVal,
ID id) |
void |
close() |
int |
count()
Gets the total scan count for this index.
|
int |
count(K attrVal)
Gets the scan count for the occurance of a specific attribute value
within the index.
|
void |
drop(ID id)
Remove all the reference to an entry from the index.
|
void |
drop(K attrVal,
ID id) |
boolean |
forward(K attrVal) |
boolean |
forward(K attrVal,
ID id) |
IndexCursor<K,O,ID> |
forwardCursor() |
IndexCursor<K,O,ID> |
forwardCursor(K key) |
boolean |
forwardGreaterOrEq(K attrVal) |
boolean |
forwardGreaterOrEq(K attrVal,
ID id) |
boolean |
forwardLessOrEq(K attrVal) |
boolean |
forwardLessOrEq(K attrVal,
ID id) |
ID |
forwardLookup(K attrVal) |
org.apache.directory.shared.ldap.cursor.Cursor<ID> |
forwardValueCursor(K key) |
org.apache.directory.shared.ldap.schema.AttributeType |
getAttribute()
Gets the attribute this Index is built upon.
|
String |
getAttributeId()
Gets the attribute identifier set at configuration time for this index which may not
be the OID but an alias name for the attributeType associated with this Index
|
int |
getCacheSize()
Gets the size of the index cache in terms of the number of index entries to be cached.
|
K |
getNormalized(K attrVal)
Gets the normalized value for an attribute.
|
File |
getWkDirPath()
Gets the working directory path to something other than the default.
|
int |
greaterThanCount(K attrVal) |
boolean |
isCountExact()
Checks whether or not calls to count the number of keys greater than or
less than the key are exact.
|
int |
lessThanCount(K attrVal) |
boolean |
reverse(ID id) |
boolean |
reverse(ID id,
K attrVal) |
IndexCursor<K,O,ID> |
reverseCursor() |
IndexCursor<K,O,ID> |
reverseCursor(ID id) |
boolean |
reverseGreaterOrEq(ID id) |
boolean |
reverseGreaterOrEq(ID id,
K attrVal) |
boolean |
reverseLessOrEq(ID id) |
boolean |
reverseLessOrEq(ID id,
K attrVal) |
K |
reverseLookup(ID id) |
org.apache.directory.shared.ldap.cursor.Cursor<K> |
reverseValueCursor(ID id) |
void |
setAttributeId(String attributeId)
Sets the attribute identifier set at configuration time for this index which may not
be the OID but an alias name for the attributeType associated with this Index
|
void |
setCacheSize(int cacheSize)
Sets the size of the index cache in terms of the number of index entries to be cached.
|
void |
setWkDirPath(File wkDirPath)
Sets the working directory path to something other than the default.
|
void |
sync() |
protected String attributeId
protected int cacheSize
protected File wkDirPath
public GenericIndex(String attributeId, int cacheSize)
attributeId
- the attribute IDcacheSize
- the cache sizepublic void close() throws Exception
public int count() throws Exception
Index
public int count(K attrVal) throws Exception
Index
public void drop(ID id) throws Exception
Index
public IndexCursor<K,O,ID> forwardCursor() throws Exception
public org.apache.directory.shared.ldap.cursor.Cursor<ID> forwardValueCursor(K key) throws Exception
public org.apache.directory.shared.ldap.schema.AttributeType getAttribute()
Index
getAttribute
in interface Index<K,O,ID>
public String getAttributeId()
Index
getAttributeId
in interface Index<K,O,ID>
public int getCacheSize()
Index
getCacheSize
in interface Index<K,O,ID>
public K getNormalized(K attrVal) throws Exception
Index
public File getWkDirPath()
Index
getWkDirPath
in interface Index<K,O,ID>
public boolean isCountExact()
Index
isCountExact
in interface Index<K,O,ID>
public IndexCursor<K,O,ID> reverseCursor() throws Exception
public org.apache.directory.shared.ldap.cursor.Cursor<K> reverseValueCursor(ID id) throws Exception
public void setAttributeId(String attributeId)
Index
setAttributeId
in interface Index<K,O,ID>
attributeId
- configured attribute oid or alias namepublic void setCacheSize(int cacheSize)
Index
setCacheSize
in interface Index<K,O,ID>
cacheSize
- the size of the index cachepublic void setWkDirPath(File wkDirPath)
Index
setWkDirPath
in interface Index<K,O,ID>
wkDirPath
- optional working directory pathCopyright © 2003-2013 The Apache Software Foundation. All Rights Reserved.