Package com.illumon.util.datastructures
Class SortedIndexableMapWrapper<K,V>
java.lang.Object
com.illumon.util.datastructures.SortedIndexableMapWrapper<K,V>
- All Implemented Interfaces:
io.deephaven.hash.IndexableMap<K,,V> Map<K,V>
public class SortedIndexableMapWrapper<K,V>
extends Object
implements io.deephaven.hash.IndexableMap<K,V>
This is a simple utility class that wraps a map, and presents it as an IndexableMap.
The getByIndex() and values() method sort the values according the passed in Comparator.
The other access methods (iteration, keySet etc. do not sort the results).
Everything that touches the values list should be synchronized.
-
Nested Class Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()computeIfAbsent(K key, Function<? super K, ? extends V> mappingFunction) computeIfPresent(K key, BiFunction<? super K, ? super V, ? extends V> remappingFunction) booleancontainsKey(Object key) booleancontainsValue(Object value) entrySet()booleanvoidforEach(BiConsumer<? super K, ? super V> action) getByIndex(int index) getOrDefault(Object key, V defaultValue) inthashCode()booleanisEmpty()keySet()voidputIfAbsent(K key, V value) booleanbooleanvoidreplaceAll(BiFunction<? super K, ? super V, ? extends V> function) intsize()values()
-
Constructor Details
-
SortedIndexableMapWrapper
-
-
Method Details
-
size
public int size() -
isEmpty
public boolean isEmpty() -
containsKey
- Specified by:
containsKeyin interfaceMap<K,V>
-
containsValue
- Specified by:
containsValuein interfaceMap<K,V>
-
get
-
put
-
remove
-
putAll
-
clear
public void clear() -
keySet
-
values
-
entrySet
-
equals
-
hashCode
public int hashCode() -
getOrDefault
- Specified by:
getOrDefaultin interfaceMap<K,V>
-
forEach
-
replaceAll
- Specified by:
replaceAllin interfaceMap<K,V>
-
putIfAbsent
- Specified by:
putIfAbsentin interfaceMap<K,V>
-
remove
-
replace
-
replace
-
computeIfAbsent
- Specified by:
computeIfAbsentin interfaceMap<K,V>
-
computeIfPresent
- Specified by:
computeIfPresentin interfaceMap<K,V>
-
compute
-
merge
-
getByIndex
-