Package dsa.lab05.base
Interface OrderedMap<Key extends Comparable<Key>,Value> 
- Type Parameters:
- Key- the key type
- Value- the value type
- All Known Implementing Classes:
- AVLTree,- AVLTree,- BinarySearchTree,- BinarySearchTree,- SortedArrayMap,- SortedArrayMap
An ordered map.
 
 A map whose n items have comparable keys,
 that is, have keys that can be ordered from least to greatest.
- 
Method SummaryModifier and TypeMethodDescriptionitems()Get a forward iterable that yields each item once.keys()Get a forward iterable that yields each key once.max()Get the item with the greatest key.min()Get the item with the least key.Get the item that would be the successor of one with the given key.Get the item that would be the predecessor of one with the given key.reversed()Get a reverse iterable that yields each item once.Get a reverse iterable that yields each key once.Methods inherited from interface java.lang.IterableforEach, spliteratorMethods inherited from interface dsa.lab04.base.MapcontainsKey, containsValue, find, get, insert, insert, remove, values
- 
Method Details- 
previousGet the item that would be the predecessor of one with the given key.The map may or may not contain an item with the given key. - Parameters:
- key- a key
- Returns:
- the previous item (by key), or nullif there is none
 
- 
nextGet the item that would be the successor of one with the given key.The map may or may not contain an item with the given key. - Parameters:
- key- a key
- Returns:
- the next item (by key), or nullif there is none
 
- 
minGet the item with the least key.- Returns:
- the minimum item (by key), or nullif there is none
 
- 
maxGet the item with the greatest key.- Returns:
- the maximum item (by key), or nullif there is none
 
- 
itemsGet a forward iterable that yields each item once.The items are iterated over in least-to-greatest order (by key). - Specified by:
- itemsin interface- Container<Key extends Comparable<Key>>
- Returns:
- an iterable over the items
 
- 
reversedGet a reverse iterable that yields each item once.The items are iterated over in greatest-to-least order (by key). - Returns:
- an iterable over the items
 
- 
keysGet a forward iterable that yields each key once.The items are iterated over in least-to-greatest order (by key). 
- 
reversedKeysGet a reverse iterable that yields each key once.The items are iterated over in greatest-to-least order (by key). - Returns:
- an iterable over the keys
 
 
-