Class TreeDequeMap<K,V>
java.lang.Object
java.util.AbstractMap<K,Deque<V>>
java.util.TreeMap<K,Deque<V>>
com.blackrook.engine.struct.TreeDequeMap<K,V>
- Type Parameters:
K- the key type.V- the value type stored.
- All Implemented Interfaces:
Serializable, Cloneable, Map<K,Deque<V>>, NavigableMap<K, Deque<V>>, SortedMap<K, Deque<V>>
-
Nested Class Summary
Nested classes/interfaces inherited from class AbstractMap
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K, V> -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new HashDequeMap that has default capacity and load factor.TreeDequeMap(Comparator<K> comparator) Creates a new HashDequeMap that has a specific capacity and default load factor. -
Method Summary
Modifier and TypeMethodDescriptionbooleanAdds a value to the end of a deque.voidAdds a value to the beginning of a deque.voidAdds a value to the end of a deque.create()Called to create a new Deque implementation that gets stored in the table.Returns the value at the beginning of a deque.Returns the value at the end of a deque.Removes a value from the front of a deque.Removes a value from the beginning of a deque.Removes a value from the end of a deque.Removes a value from the front of a deque.voidAdds a value to the front of a deque.removeFirst(K key) Removes a value from the beginning of a deque.removeLast(K key) Removes a value from the end of a deque.booleanremoveValue(K key, V value) Removes a value from a deque.Methods inherited from class TreeMap
ceilingEntry, ceilingKey, clear, clone, comparator, containsKey, containsValue, descendingKeySet, descendingMap, entrySet, firstEntry, firstKey, floorEntry, floorKey, forEach, get, headMap, headMap, higherEntry, higherKey, keySet, lastEntry, lastKey, lowerEntry, lowerKey, navigableKeySet, pollFirstEntry, pollLastEntry, put, putAll, remove, replace, replace, replaceAll, size, subMap, subMap, tailMap, tailMap, valuesMethods inherited from class AbstractMap
equals, hashCode, isEmpty, toStringMethods inherited from interface Map
compute, computeIfAbsent, computeIfPresent, equals, getOrDefault, hashCode, isEmpty, merge, putIfAbsent, remove
-
Constructor Details
-
TreeDequeMap
public TreeDequeMap()Creates a new HashDequeMap that has default capacity and load factor. -
TreeDequeMap
Creates a new HashDequeMap that has a specific capacity and default load factor.- Parameters:
comparator- the initial capacity.
-
-
Method Details
-
create
-
addFirst
-
addLast
-
removeFirst
Removes a value from the beginning of a deque. If no corresponding deque, this throws an exception.- Parameters:
key- the key.- Returns:
- the element removed.
- Throws:
NoSuchElementException- if the key does not correspond to an existing deque.- See Also:
-
removeLast
Removes a value from the end of a deque. If no corresponding deque, this throws an exception.- Parameters:
key- the key.- Returns:
- the element removed.
- Throws:
NoSuchElementException- if the key does not correspond to an existing deque.- See Also:
-
pollFirst
-
pollLast
-
peekFirst
-
peekLast
-
add
Adds a value to the end of a deque. If no corresponding deque, this creates a new deque.- Parameters:
key- the key.value- the value.- Returns:
- true (as specified by
Collection.add(Object)) - See Also:
-
removeValue
Removes a value from a deque. If no corresponding deque, this returns false.- Parameters:
key- the key.value- the value to remove.- Returns:
trueif an element was removed as a result of this call- Throws:
ClassCastException- if the class of the specified element is incompatible with the deque (optional)NullPointerException- if the specified element is null and this deque does not permit null elements (optional)- See Also:
-
pop
Removes a value from the front of a deque. If no corresponding deque, this throws an exception.- Parameters:
key- the key.- Returns:
- the element removed.
- Throws:
NoSuchElementException- if the key does not correspond to an existing deque.- See Also:
-
poll
-
push
-