org.apache.directory.server.xdbm
Class AbstractTable<K,V>

java.lang.Object
  extended by org.apache.directory.server.xdbm.AbstractTable<K,V>
Type Parameters:
K - The key
V - The stored value
All Implemented Interfaces:
Table<K,V>
Direct Known Subclasses:
AvlTable

public abstract class AbstractTable<K,V>
extends Object
implements Table<K,V>

A Abstract Table implementation aggregating the methods comon with all the different Table implementation.

Author:
Apache Directory Project

Field Summary
protected  int count
          the current count of entries in this Table
protected  Comparator<K> keyComparator
          a key comparator for the keys in this Table
protected  String name
          the name of this table
protected  org.apache.directory.shared.ldap.model.schema.SchemaManager schemaManager
          The global SchemaManager
protected  Comparator<V> valueComparator
          a value comparator for the values in this Table
 
Constructor Summary
protected AbstractTable(org.apache.directory.shared.ldap.model.schema.SchemaManager schemaManager, String name, Comparator<K> keyComparator, Comparator<V> valueComparator)
          Create an instance of Table
 
Method Summary
 int count()
          Gets the count of the number of records in this Table.
 Comparator<K> getKeyComparator()
          Gets the key comparator used by this Table: may be null if this Table was not initialized with one.
 String getName()
          Gets the name of this Table.
 Comparator<V> getValueComparator()
          Gets the value comparator used by this Table: may be null if this Table was not initialized with one.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.directory.server.xdbm.Table
close, count, cursor, cursor, get, greaterThanCount, has, has, hasGreaterOrEqual, hasGreaterOrEqual, hasLessOrEqual, hasLessOrEqual, isDupsEnabled, lessThanCount, put, remove, remove, valueCursor
 

Field Detail

name

protected final String name
the name of this table


schemaManager

protected org.apache.directory.shared.ldap.model.schema.SchemaManager schemaManager
The global SchemaManager


keyComparator

protected final Comparator<K> keyComparator
a key comparator for the keys in this Table


valueComparator

protected final Comparator<V> valueComparator
a value comparator for the values in this Table


count

protected int count
the current count of entries in this Table

Constructor Detail

AbstractTable

protected AbstractTable(org.apache.directory.shared.ldap.model.schema.SchemaManager schemaManager,
                        String name,
                        Comparator<K> keyComparator,
                        Comparator<V> valueComparator)
Create an instance of Table

Parameters:
schemaManager - The server schemaManager
name - the name of the table
keyComparator - a key comparator
valueComparator - a value comparator
Method Detail

getKeyComparator

public Comparator<K> getKeyComparator()
Gets the key comparator used by this Table: may be null if this Table was not initialized with one.

Specified by:
getKeyComparator in interface Table<K,V>
Returns:
the key comparator or null if this Table was not created with one.

getValueComparator

public Comparator<V> getValueComparator()
Gets the value comparator used by this Table: may be null if this Table was not initialized with one.

Specified by:
getValueComparator in interface Table<K,V>
Returns:
the value comparator or null if this Table was not created with one.

getName

public String getName()
Gets the name of this Table.

Specified by:
getName in interface Table<K,V>
Returns:
the name

count

public int count()
          throws IOException
Gets the count of the number of records in this Table.

Specified by:
count in interface Table<K,V>
Returns:
the number of records
Throws:
IOException


Copyright © 2003-2012 The Apache Software Foundation. All Rights Reserved.