|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.directory.server.core.partition.impl.btree.jdbm.JdbmTable
public class JdbmTable
A jdbm Btree wrapper that enables duplicate sorted keys using collections.
Constructor Summary | |
---|---|
JdbmTable(java.lang.String name,
boolean allowsDuplicates,
int numDupLimit,
RecordManager manager,
TupleComparator comparator)
Creates a Jdbm BTree based tuple Table abstraction that enables duplicates. |
|
JdbmTable(java.lang.String name,
RecordManager manager,
SerializableComparator keyComparator)
Creates a Jdbm BTree based tuple Table abstraction without duplicates enabled using a simple key comparator. |
Method Summary | |
---|---|
void |
close()
Closes the underlying Db of this Table. |
int |
count()
Gets the count of the number of records in this Table. |
int |
count(java.lang.Object key)
Gets the count of the number of records in this Table with a specific key: returns the number of duplicates for a key. |
int |
count(java.lang.Object key,
boolean isGreaterThan)
Returns the number of records greater than or less than a key value. |
java.lang.Object |
get(java.lang.Object key)
Gets the value of a record by key if the key exists. |
TupleComparator |
getComparator()
Gets the comparator used by this Table: may be null if this Table was not initialized with one. |
java.lang.String |
getName()
Gets the name of this Table. |
TupleRenderer |
getRenderer()
Gets the data renderer used by this Table to display or log records keys and values. |
boolean |
has(java.lang.Object key)
Checks to see if this table has a key: same as a get call with a check to see if the returned value is null or not. |
boolean |
has(java.lang.Object key,
boolean isGreaterThan)
Checks to see if this table has a record with a key greater/less than or equal to the key argument. |
boolean |
has(java.lang.Object key,
java.lang.Object value)
Checks to see if this table has a key with a specific value. |
boolean |
has(java.lang.Object key,
java.lang.Object val,
boolean isGreaterThan)
Checks to see if this table has a record with a key equal to the argument key with a value greater/less than or equal to the value argument provided. |
boolean |
isDupsEnabled()
Checks to see if this Table has enabled the use of duplicate keys. |
boolean |
isSortedDupsEnabled()
Checks to see if this Table has enabled sorting on the values of duplicate keys. |
javax.naming.NamingEnumeration |
listTuples()
Sets a cursor to the first record in the Table and enables single next steps across all records. |
javax.naming.NamingEnumeration |
listTuples(java.lang.Object key)
Sets a cursor to the first record in the Table with a key value of key and enables single next steps across all duplicate records with this key. |
javax.naming.NamingEnumeration |
listTuples(java.lang.Object key,
boolean isGreaterThan)
Sets a cursor to the first record in the Table with a key value greater/less than or equal to key and enables single next steps across all records with key values equal to or less/greater than key. |
javax.naming.NamingEnumeration |
listTuples(java.lang.Object key,
java.lang.Object val,
boolean isGreaterThan)
Sets a cursor to the first record in the Table with a key equal to the key argument whose value is greater/less than or equal to val and enables single next steps across all records with key equal to key. |
javax.naming.NamingEnumeration |
listValues(java.lang.Object key)
Sets a enumeration to the first record in the Table with a key value of key and enables single next steps across all duplicate records with this key. |
java.lang.Object |
put(java.lang.Object key,
javax.naming.NamingEnumeration values)
Efficiently puts a set of values into the Table. |
java.lang.Object |
put(java.lang.Object key,
java.lang.Object value)
Puts a record into this Table. |
java.lang.Object |
remove(java.lang.Object key)
Removes all records with key from this Table. |
java.lang.Object |
remove(java.lang.Object key,
javax.naming.NamingEnumeration values)
Removes a set of values with the same key from this Table. |
java.lang.Object |
remove(java.lang.Object key,
java.lang.Object value)
Removes a single specific record with key and value from this Table. |
void |
setRenderer(TupleRenderer renderer)
Sets the data renderer to by used by this Table to display or log record keys and values. |
void |
sync()
Synchronizes the buffers with disk. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JdbmTable(java.lang.String name, boolean allowsDuplicates, int numDupLimit, RecordManager manager, TupleComparator comparator) throws javax.naming.NamingException
name
- the name of the tableallowsDuplicates
- whether or not duplicates are enabledmanager
- the record manager to be used for this tablecomparator
- a tuple comparator
javax.naming.NamingException
- if the table's file cannot be createdpublic JdbmTable(java.lang.String name, RecordManager manager, SerializableComparator keyComparator) throws javax.naming.NamingException
name
- the name of the tablemanager
- the record manager to be used for this tablekeyComparator
- a tuple comparator
javax.naming.NamingException
- if the table's file cannot be createdMethod Detail |
---|
public TupleComparator getComparator()
Table
getComparator
in interface Table
Table.getComparator()
public boolean isDupsEnabled()
Table
isDupsEnabled
in interface Table
Table.isDupsEnabled()
public java.lang.String getName()
Table
getName
in interface Table
Table.getName()
public TupleRenderer getRenderer()
Table
getRenderer
in interface Table
Table.getRenderer()
public void setRenderer(TupleRenderer renderer)
Table
setRenderer
in interface Table
renderer
- the DataRenderer instance to used as the renderer.Table.setRenderer(
TupleRenderer)
public boolean isSortedDupsEnabled()
Table
isSortedDupsEnabled
in interface Table
Table.isSortedDupsEnabled()
public int count(java.lang.Object key, boolean isGreaterThan) throws javax.naming.NamingException
Table
count
in interface Table
key
- the Object key to count.isGreaterThan
- boolean set to true to count for greater than and
equal to record keys, or false for less than or equal to keys.
javax.naming.NamingException
- if there is a failure to read the underlying DbTable.count(java.lang.Object, boolean)
public int count(java.lang.Object key) throws javax.naming.NamingException
Table
count
in interface Table
key
- the Object key to count.
javax.naming.NamingException
- if there is a failure to read the underlying DbTable.count(java.lang.Object)
public int count() throws javax.naming.NamingException
Table
count
in interface Table
javax.naming.NamingException
- if there is a failure to read the underlying DbTable.count()
public java.lang.Object get(java.lang.Object key) throws javax.naming.NamingException
Table
get
in interface Table
key
- the key of the record
javax.naming.NamingException
- if there is a failure to read the underlying DbTable.get(java.lang.Object)
public boolean has(java.lang.Object key, java.lang.Object val, boolean isGreaterThan) throws javax.naming.NamingException
Table
has
in interface Table
key
- the key Objectval
- the value Object to compare values toisGreaterThan
- boolean for greater than or less then comparison
javax.naming.NamingException
- if there is a failure to read the underlying Db
or if the underlying Db is not of the Btree type that allows sorted
duplicate values.Table.has(java.lang.Object,
java.lang.Object, boolean)
public boolean has(java.lang.Object key, boolean isGreaterThan) throws javax.naming.NamingException
Table
has
in interface Table
key
- the key Object to compare keys toisGreaterThan
- boolean for greater than or less then comparison
javax.naming.NamingException
- if there is a failure to read the underlying Db,
or if the underlying Db is not a Btree.Table.has(java.lang.Object, boolean)
public boolean has(java.lang.Object key, java.lang.Object value) throws javax.naming.NamingException
Table
has
in interface Table
key
- the key Object to check forvalue
- the value Object to check for
javax.naming.NamingException
- if there is a failure to read the underlying DbTable.has(java.lang.Object,
java.lang.Object)
public boolean has(java.lang.Object key) throws javax.naming.NamingException
Table
has
in interface Table
key
- the Object of the key to check for
javax.naming.NamingException
- if there is a failure to read the underlying DbTable.has(java.lang.Object)
public java.lang.Object put(java.lang.Object key, java.lang.Object value) throws javax.naming.NamingException
Table
put
in interface Table
key
- the key of the recordvalue
- the value of the record.
javax.naming.NamingException
- if there is a failure to read or write to
the underlying DbTable.put(java.lang.Object,
java.lang.Object)
public java.lang.Object put(java.lang.Object key, javax.naming.NamingEnumeration values) throws javax.naming.NamingException
Table
put
in interface Table
key
- the key to use for the valuesvalues
- the values supplied as an enumeration
javax.naming.NamingException
- if something goes wrongTable.put(java.lang.Object,
javax.naming.NamingEnumeration)
public java.lang.Object remove(java.lang.Object key, java.lang.Object value) throws javax.naming.NamingException
Table
remove
in interface Table
key
- the key of the record to removevalue
- the value of the record to remove
javax.naming.NamingException
- if there is a failure to read or write to
the underlying DbTable.remove(java.lang.Object,
java.lang.Object)
public java.lang.Object remove(java.lang.Object key, javax.naming.NamingEnumeration values) throws javax.naming.NamingException
Table
remove
in interface Table
key
- the key of the records to remove
javax.naming.NamingException
- if there is a failure to read or write to
the underlying DbTable.remove(java.lang.Object,
javax.naming.NamingEnumeration)
public java.lang.Object remove(java.lang.Object key) throws javax.naming.NamingException
Table
remove
in interface Table
key
- the key of the records to remove
javax.naming.NamingException
- if there is a failure to read or write to
the underlying DbTable.remove(java.lang.Object)
public javax.naming.NamingEnumeration listValues(java.lang.Object key) throws javax.naming.NamingException
Table
listValues
in interface Table
key
- the key to iterate over
javax.naming.NamingException
- if the underlying browser could not be setTable.listValues(java.lang.Object)
public javax.naming.NamingEnumeration listTuples() throws javax.naming.NamingException
Table
listTuples
in interface Table
javax.naming.NamingException
- if the underlying cursor could not be set.Table.listTuples()
public javax.naming.NamingEnumeration listTuples(java.lang.Object key) throws javax.naming.NamingException
Table
listTuples
in interface Table
key
- the key to iterate over
javax.naming.NamingException
- if the underlying cursor could not be setTable.listTuples(java.lang.Object)
public javax.naming.NamingEnumeration listTuples(java.lang.Object key, boolean isGreaterThan) throws javax.naming.NamingException
Table
listTuples
in interface Table
key
- the key to use to position this cursor to record with a key
greater/less than or equal to itisGreaterThan
- if true the cursor iterates up over ascending keys
greater than or equal to the key argument, but if false this cursor
iterates down over descending keys less than or equal to key argument
javax.naming.NamingException
- if the underlying cursor could not be setTable.listTuples(java.lang.Object,
boolean)
public javax.naming.NamingEnumeration listTuples(java.lang.Object key, java.lang.Object val, boolean isGreaterThan) throws javax.naming.NamingException
Table
listTuples
in interface Table
key
- the key to use to position this cursor to record with a key
equal to it.val
- the value to use to position this cursor to record with a
value greater/less than or equal to it.isGreaterThan
- if true the cursor iterates up over ascending
values greater than or equal to the val argument, but if false this
cursor iterates down over descending values less than or equal to val
argument starting from the largest value going down
javax.naming.NamingException
- if the underlying cursor could not be set or
this method is called over a cursor on a table that does not have sorted
duplicates enabled.Table.listTuples(java.lang.Object,
java.lang.Object, boolean)
public void close() throws javax.naming.NamingException
Table
close
in interface Table
javax.naming.NamingException
- on any failuresTable.close()
public void sync() throws javax.naming.NamingException
javax.naming.NamingException
- if errors are encountered on the flush
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |