|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface AvlTreeMap<K,V>
An interface to the AVL tree based map. The implementations should hold a value(s) along with a key
Method Summary | |
---|---|
LinkedAvlMapNode<K,V> |
find(K key)
Find a LinkedAvlMapNode with the given key value in the tree. |
LinkedAvlMapNode<K,V> |
find(K key,
V value)
Find a LinkedAvlMapNode with the given key and value in the tree. |
LinkedAvlMapNode<K,V> |
findGreater(K key)
Finds a LinkedAvlMapNode |
LinkedAvlMapNode<K,V> |
findGreaterOrEqual(K key)
Finds a LinkedAvlMapNode |
LinkedAvlMapNode<K,V> |
findLess(K key)
Finds a LinkedAvlMapNode |
LinkedAvlMapNode<K,V> |
findLessOrEqual(K key)
Finds a LinkedAvlMapNode |
LinkedAvlMapNode<K,V> |
getFirst()
|
java.util.Comparator<K> |
getKeyComparator()
|
java.util.List<K> |
getKeys()
|
LinkedAvlMapNode<K,V> |
getLast()
|
LinkedAvlMapNode<K,V> |
getRoot()
|
int |
getSize()
returns the number of nodes present in this tree. |
java.util.Comparator<V> |
getValueComparator()
|
V |
insert(K key,
V value)
Inserts a LinkedAvlMapNode with the given key and value. |
boolean |
isDupsAllowed()
tells if the duplicate keys are supported or not. |
boolean |
isEmpty()
Tests if the tree is logically empty. |
void |
printTree()
Prints the contents of AVL tree in pretty format |
SingletonOrOrderedSet<V> |
remove(K key)
Removes a node associated with the given key The entire node will be removed irrespective of whether duplicate keys are enabled or not |
V |
remove(K key,
V value)
Removes the LinkedAvlMapNode present in the tree with the given key and value |
Method Detail |
---|
java.util.Comparator<K> getKeyComparator()
java.util.Comparator<V> getValueComparator()
V insert(K key, V value)
key
- the item to be insertedvalue
- the value associated with the key
V remove(K key, V value)
key
- the key of the node to be removedvalue
- the value of the node
java.lang.IllegalArgumentException
- if key or value is nullSingletonOrOrderedSet<V> remove(K key)
key
- the key of the node to be removed
java.lang.IllegalArgumentException
- if key is nullboolean isEmpty()
int getSize()
LinkedAvlMapNode<K,V> getRoot()
java.util.List<K> getKeys()
void printTree()
LinkedAvlMapNode<K,V> getFirst()
LinkedAvlMapNode<K,V> getLast()
LinkedAvlMapNode<K,V> findGreater(K key)
key
- the key
LinkedAvlMapNode<K,V> findGreaterOrEqual(K key)
key
- the key
LinkedAvlMapNode<K,V> findLess(K key)
key
- the key
LinkedAvlMapNode<K,V> findLessOrEqual(K key)
key
- the key
LinkedAvlMapNode<K,V> find(K key)
key
- the key to find
LinkedAvlMapNode<K,V> find(K key, V value)
key
- the key of the nodevalue
- the value of the node
boolean isDupsAllowed()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |