|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.ObjectsearchTree.SearchTreeMap<K,V>
@DefaultAnnotationForParameters(value=edu.umd.cs.findbugs.annotations.Nullable.class) public class SearchTreeMap<K extends java.lang.Comparable<K>,V>
This class provides a partial implementation of the Map interface. The implementation uses classes implementing the Tree interface to represent the actual search tree. All the methods of this class have been implemented, except keyList and subMap.
| Constructor Summary | |
|---|---|
SearchTreeMap()
|
|
| Method Summary | |
|---|---|
V |
get(K k)
Find the value the key is mapped to |
K |
getMax()
Return the maximum key value in the set |
K |
getMin()
Return the minimum key value in the set |
java.util.List<K> |
keyList()
Return list of keys in map in natural/incresing sorted order |
java.util.Set<K> |
keySet()
Return a Set of all the keys in the map |
void |
put(K k,
V v)
Update the mapping for the key |
void |
remove(K k)
Remove any existing binding for a key |
int |
size()
Return number of keys bound by this map |
SearchTreeMap<K,V> |
subMap(K fromKey,
K toKey)
Return subset of TreeMap between the values fromKey-toKey. |
java.lang.String |
toString()
Return a string representation of the tree |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public SearchTreeMap()
| Method Detail |
|---|
@CheckForNull public V get(K k)
k - -
Search key
public void put(K k,
V v)
k - -
key valuev - -
value the key should be bound topublic int size()
public void remove(K k)
k - -
key to be removed from the mappublic java.util.Set<K> keySet()
@CheckForNull public K getMin()
@CheckForNull public K getMax()
public java.lang.String toString()
toString in class java.lang.Objectpublic java.util.List<K> keyList()
public SearchTreeMap<K,V> subMap(K fromKey,
K toKey)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||