org.apache.directory.server.core.partition.avl
Class AvlTable<K,V>

java.lang.Object
  extended by org.apache.directory.server.core.partition.avl.AvlTable<K,V>
All Implemented Interfaces:
Table<K,V>
Direct Known Subclasses:
AvlMasterTable

public class AvlTable<K,V>
extends java.lang.Object
implements Table<K,V>

A Table implementation backed by in memory AVL tree.

Version:
$Rev$, $Date$
Author:
Apache Directory Project

Constructor Summary
AvlTable(java.lang.String name, java.util.Comparator<K> keyComparator, java.util.Comparator<V> valComparator, boolean dupsEnabled)
           
 
Method Summary
 void close()
          Does nothing.
 int count()
          
 int count(K key)
          
 org.apache.directory.shared.ldap.cursor.Cursor<Tuple<K,V>> cursor()
          
 org.apache.directory.shared.ldap.cursor.Cursor<Tuple<K,V>> cursor(K key)
          
 V get(K key)
          
 java.util.Comparator<K> getKeyComparator()
          
 java.lang.String getName()
          
 java.util.Comparator<V> getValueComparator()
          
 int greaterThanCount(K key)
          
 boolean has(K key)
          
 boolean has(K key, V value)
          
 boolean hasGreaterOrEqual(K key)
          
 boolean hasGreaterOrEqual(K key, V val)
          
 boolean hasLessOrEqual(K key)
          
 boolean hasLessOrEqual(K key, V val)
          
 boolean isCountExact()
          
 boolean isDupsEnabled()
          
 int lessThanCount(K key)
          
 void put(K key, V value)
          
 void remove(K key)
          
 void remove(K key, V value)
          
 org.apache.directory.shared.ldap.cursor.Cursor<V> valueCursor(K key)
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AvlTable

public AvlTable(java.lang.String name,
                java.util.Comparator<K> keyComparator,
                java.util.Comparator<V> valComparator,
                boolean dupsEnabled)
Method Detail

close

public void close()
           throws java.lang.Exception
Does nothing.

Specified by:
close in interface Table<K,V>
Throws:
java.lang.Exception

count

public int count()
          throws java.lang.Exception

Specified by:
count in interface Table<K,V>
Throws:
java.lang.Exception

count

public int count(K key)
          throws java.lang.Exception

Specified by:
count in interface Table<K,V>
Throws:
java.lang.Exception

get

public V get(K key)
      throws java.lang.Exception

Specified by:
get in interface Table<K,V>
Throws:
java.lang.Exception

getKeyComparator

public java.util.Comparator<K> getKeyComparator()

Specified by:
getKeyComparator in interface Table<K,V>

getValueComparator

public java.util.Comparator<V> getValueComparator()

Specified by:
getValueComparator in interface Table<K,V>

getName

public java.lang.String getName()

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

greaterThanCount

public int greaterThanCount(K key)
                     throws java.lang.Exception

Specified by:
greaterThanCount in interface Table<K,V>
Throws:
java.lang.Exception

has

public boolean has(K key)
            throws java.lang.Exception

Specified by:
has in interface Table<K,V>
Throws:
java.lang.Exception

has

public boolean has(K key,
                   V value)
            throws java.lang.Exception

Specified by:
has in interface Table<K,V>
Throws:
java.lang.Exception

hasGreaterOrEqual

public boolean hasGreaterOrEqual(K key)
                          throws java.lang.Exception

Specified by:
hasGreaterOrEqual in interface Table<K,V>
Throws:
java.lang.Exception

hasGreaterOrEqual

public boolean hasGreaterOrEqual(K key,
                                 V val)
                          throws java.lang.Exception

Specified by:
hasGreaterOrEqual in interface Table<K,V>
Throws:
java.lang.Exception

hasLessOrEqual

public boolean hasLessOrEqual(K key)
                       throws java.lang.Exception

Specified by:
hasLessOrEqual in interface Table<K,V>
Throws:
java.lang.Exception

hasLessOrEqual

public boolean hasLessOrEqual(K key,
                              V val)
                       throws java.lang.Exception

Specified by:
hasLessOrEqual in interface Table<K,V>
Throws:
java.lang.Exception

isCountExact

public boolean isCountExact()

Specified by:
isCountExact in interface Table<K,V>

isDupsEnabled

public boolean isDupsEnabled()

Specified by:
isDupsEnabled in interface Table<K,V>

lessThanCount

public int lessThanCount(K key)
                  throws java.lang.Exception

Specified by:
lessThanCount in interface Table<K,V>
Throws:
java.lang.Exception

put

public void put(K key,
                V value)
         throws java.lang.Exception

Specified by:
put in interface Table<K,V>
Throws:
java.lang.Exception

remove

public void remove(K key)
            throws java.lang.Exception

Specified by:
remove in interface Table<K,V>
Throws:
java.lang.Exception

remove

public void remove(K key,
                   V value)
            throws java.lang.Exception

Specified by:
remove in interface Table<K,V>
Throws:
java.lang.Exception

cursor

public org.apache.directory.shared.ldap.cursor.Cursor<Tuple<K,V>> cursor()
                                                                  throws java.lang.Exception

Specified by:
cursor in interface Table<K,V>
Throws:
java.lang.Exception

cursor

public org.apache.directory.shared.ldap.cursor.Cursor<Tuple<K,V>> cursor(K key)
                                                                  throws java.lang.Exception

Specified by:
cursor in interface Table<K,V>
Throws:
java.lang.Exception

valueCursor

public org.apache.directory.shared.ldap.cursor.Cursor<V> valueCursor(K key)
                                                              throws java.lang.Exception

Specified by:
valueCursor in interface Table<K,V>
Throws:
java.lang.Exception


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