public class FastSortedMap<K,V> extends FastMap<K,V> implements SortedMap<K,V>
A high-performance sorted map with real-time
behavior.
This map provides a total ordering based on the keys natural order or
using custom comparators
.
Modifier | Constructor and Description |
---|---|
|
FastSortedMap()
Creates an empty sorted map ordered on keys natural order.
|
|
FastSortedMap(Equality<? super K> keyComparator)
Creates an empty sorted map ordered using the specified comparator
for order.
|
|
FastSortedMap(Equality<? super K> keyComparator,
Equality<? super V> valueComparator)
Creates an empty sorted map ordered using the specified key comparator
for order and value comparator for values equality.
|
protected |
FastSortedMap(SortedMapService<K,V> service)
Creates a sorted map backed up by the specified service implementation.
|
Modifier and Type | Method and Description |
---|---|
FastSortedMap<K,V> |
atomic()
Returns an atomic view over this map.
|
Comparator<? super K> |
comparator()
Returns the comparator used to order the keys in this map (never null).
|
boolean |
containsKey(Object key)
Indicates if this map contains the specified key.
|
FastSortedSet<Map.Entry<K,V>> |
entrySet()
Returns a set view of the mappings contained in
this map.
|
K |
firstKey()
Returns the first (lowest) key currently in this map.
|
V |
get(Object key)
Returns the value for the specified key.
|
FastSortedMap<K,V> |
headMap(K toKey)
Returns a view of the portion of this map whose keys are strictly less than toKey.
|
FastSortedSet<K> |
keySet()
Returns a set view of the keys contained in this map.
|
K |
lastKey()
Returns the last (highest) key currently in this map.
|
V |
put(K key,
V value)
Associates the specified value with the specified key.
|
FastSortedMap<K,V> |
putAll(FastMap<? extends K,? extends V> that)
Returns this map with the specified map's entries added.
|
V |
putIfAbsent(K key,
V value)
Associates the specified value with the specified key only if the
specified key has no current mapping.
|
V |
remove(Object key)
Removes the entry for the specified key.
|
boolean |
remove(Object key,
Object value)
Removes the entry for a key only if currently mapped to a given value.
|
V |
replace(K key,
V value)
Replaces the entry for a key only if currently mapped to some value.
|
boolean |
replace(K key,
V oldValue,
V newValue)
Replaces the entry for a key only if currently mapped to a given value.
|
protected SortedMapService<K,V> |
service()
Returns this map service implementation.
|
FastSortedMap<K,V> |
shared()
Returns a thread-safe view over this map.
|
FastSortedMap<K,V> |
subMap(K fromKey,
K toKey)
Returns a view of the portion of this map whose keys range from fromKey, inclusive, to toKey, exclusive.
|
FastSortedMap<K,V> |
tailMap(K fromKey)
Returns a view of the portion of this map whose keys are greater than or equal to fromKey.
|
FastSortedMap<K,V> |
unmodifiable()
Returns an unmodifiable view over this map.
|
clear, containsValue, isEmpty, parallel, perform, putAll, sequential, size, toImmutable, toString, update, values
public FastSortedMap()
public FastSortedMap(Equality<? super K> keyComparator)
public FastSortedMap(Equality<? super K> keyComparator, Equality<? super V> valueComparator)
protected FastSortedMap(SortedMapService<K,V> service)
public FastSortedMap<K,V> atomic()
FastMap
ConcurrentModificationException
possible).public FastSortedMap<K,V> shared()
FastMap
ConcurrentModificationException
possible).public FastSortedMap<K,V> unmodifiable()
FastMap
UnsupportedOperationException
being raised.unmodifiable
in class FastMap<K,V>
public FastSortedSet<Map.Entry<K,V>> entrySet()
FastMap
public FastSortedSet<K> keySet()
FastMap
null
.public FastSortedMap<K,V> subMap(K fromKey, K toKey)
public FastSortedMap<K,V> headMap(K toKey)
public FastSortedMap<K,V> tailMap(K fromKey)
@Realtime(limit=LOG_N) public boolean containsKey(Object key)
FastMap
containsKey
in interface Map<K,V>
containsKey
in class FastMap<K,V>
@Realtime(limit=LOG_N) public V get(Object key)
FastMap
@Realtime(limit=LOG_N) public V put(K key, V value)
FastMap
@Realtime(limit=LOG_N) public V remove(Object key)
FastMap
@Realtime(limit=LOG_N) public V putIfAbsent(K key, V value)
FastMap
putIfAbsent
in interface ConcurrentMap<K,V>
putIfAbsent
in class FastMap<K,V>
@Realtime(limit=LOG_N) public boolean remove(Object key, Object value)
FastMap
@Realtime(limit=LOG_N) public boolean replace(K key, V oldValue, V newValue)
FastMap
@Realtime(limit=LOG_N) public V replace(K key, V value)
FastMap
public K firstKey()
public K lastKey()
public Comparator<? super K> comparator()
comparator
in interface SortedMap<K,V>
public FastSortedMap<K,V> putAll(FastMap<? extends K,? extends V> that)
FastMap
Copyright © 2005-2013 Javolution. All Rights Reserved.