public class FastSortedMap<K,V> extends FastMap<K,V> implements SortedMap<K,V>
A high-performance sorted map with real-time
behavior;
smooth capacity increase/decrease and minimal memory footprint.
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(EqualityComparator<? super K> keyComparator)
Creates an empty sorted map ordered using the specified comparator
for order.
|
|
FastSortedMap(EqualityComparator<? super K> keyComparator,
EqualityComparator<? 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 |
---|---|
Comparator<? super K> |
comparator() |
boolean |
containsKey(Object key)
FastMap operations with different time limit behavior.
|
FastSortedSet<Map.Entry<K,V>> |
entrySet()
Returns a set view of the mappings contained in
this map.
|
K |
firstKey()
SortedMap operations.
|
V |
get(Object key) |
FastSortedMap<K,V> |
headMap(K toKey) |
FastSortedSet<K> |
keySet()
Returns a set view of the keys contained in this map.
|
K |
lastKey() |
V |
put(K key,
V value) |
FastSortedMap<K,V> |
putAll(FastMap<? extends K,? extends V> that)
Misc.
|
V |
putIfAbsent(K key,
V value)
ConcurrentMap Interface.
|
V |
remove(Object key) |
boolean |
remove(Object key,
Object value) |
V |
replace(K key,
V value) |
boolean |
replace(K key,
V oldValue,
V newValue) |
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) |
FastSortedMap<K,V> |
tailMap(K fromKey) |
FastSortedMap<K,V> |
unmodifiable()
Views.
|
atomic, clear, containsValue, isEmpty, putAll, size, toImmutable, values
public FastSortedMap()
public FastSortedMap(EqualityComparator<? super K> keyComparator)
public FastSortedMap(EqualityComparator<? super K> keyComparator, EqualityComparator<? super V> valueComparator)
protected FastSortedMap(SortedMapService<K,V> service)
public FastSortedMap<K,V> unmodifiable()
unmodifiable
in class FastMap<K,V>
public FastSortedMap<K,V> shared()
FastMap
immutable
maps to be replaced at each update rather than shared views.shared
in class FastMap<K,V>
public FastSortedSet<Map.Entry<K,V>> entrySet()
FastMap
public FastSortedSet<K> keySet()
FastMap
@Realtime(limit=LOG_N) public boolean containsKey(Object key)
containsKey
in interface Map<K,V>
containsKey
in class FastMap<K,V>
@Realtime(limit=LOG_N) public V putIfAbsent(K key, V value)
FastMap
putIfAbsent
in interface ConcurrentMap<K,V>
putIfAbsent
in class FastMap<K,V>
public K firstKey()
public Comparator<? super K> comparator()
comparator
in interface SortedMap<K,V>
Copyright © 2005-2013 Javolution. All Rights Reserved.