V
- public final class IntTreePMap<V> extends AbstractMap<Integer,V> implements PMap<Integer,V>, Serializable
Iteration occurs in the integer order of the keys.
This implementation is thread-safe (assuming Java's AbstractMap and AbstractSet are thread-safe), although its iterators may not be.
The balanced tree is based on the Glasgow Haskell Compiler's Data.Map implementation, which in turn is based on "size balanced binary trees" as described by:
Stephen Adams, "Efficient sets: a balancing act", Journal of Functional Programming 3(4):553-562, October 1993, http://www.swiss.ai.mit.edu/~adams/BB/.
J. Nievergelt and E.M. Reingold, "Binary search trees of bounded balance", SIAM journal of computing 2(1), March 1973.
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
Modifier and Type | Method and Description |
---|---|
boolean |
containsKey(Object key) |
static <V> IntTreePMap<V> |
empty() |
Set<Map.Entry<Integer,V>> |
entrySet() |
static <V> IntTreePMap<V> |
from(Map<? extends Integer,? extends V> map) |
V |
get(Object key) |
IntTreePMap<V> |
minus(Object key) |
IntTreePMap<V> |
minusAll(Collection<?> keys) |
IntTreePMap<V> |
minusRange(int start,
int end) |
IntTreePMap<V> |
plus(Integer key,
V value) |
IntTreePMap<V> |
plusAll(Map<? extends Integer,? extends V> map) |
static <V> IntTreePMap<V> |
singleton(Integer key,
V value) |
int |
size() |
clear, clone, containsValue, equals, hashCode, isEmpty, keySet, put, putAll, remove, toString, values
finalize, getClass, notify, notifyAll, wait, wait, wait
compute, computeIfAbsent, computeIfPresent, containsValue, equals, forEach, getOrDefault, hashCode, isEmpty, keySet, merge, putIfAbsent, remove, replace, replace, replaceAll, values
public static <V> IntTreePMap<V> empty()
V
- public static <V> IntTreePMap<V> singleton(Integer key, V value)
V
- key
- value
- public static <V> IntTreePMap<V> from(Map<? extends Integer,? extends V> map)
V
- map
- public IntTreePMap<V> minusRange(int start, int end)
V
- start
- end
- public int size()
public boolean containsKey(Object key)
containsKey
in interface Map<Integer,V>
containsKey
in class AbstractMap<Integer,V>
public IntTreePMap<V> plus(Integer key, V value)
public IntTreePMap<V> minus(Object key)
public IntTreePMap<V> plusAll(Map<? extends Integer,? extends V> map)
public IntTreePMap<V> minusAll(Collection<?> keys)
Copyright © 2019. All rights reserved.