Module org.jhotdraw8.fxcollection
Class SharedKeysMap<K,V>
java.lang.Object
java.util.AbstractMap<K,V>
org.jhotdraw8.fxcollection.sharedkeys.SharedKeysMap<K,V>
- Type Parameters:
K- key typeV- value type
- All Implemented Interfaces:
Map<K,,V> javafx.beans.Observable,javafx.collections.ObservableMap<K,V>
public class SharedKeysMap<K,V>
extends AbstractMap<K,V>
implements javafx.collections.ObservableMap<K,V>
An observable map which stores its values in an array, and which shares
its immutable keys with other
SharedKeysMap instances.- Author:
- Werner Randelshofer
-
Nested Class Summary
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K, V> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddListener(javafx.beans.InvalidationListener listener) voidaddListener(javafx.collections.MapChangeListener<? super K, ? super V> observer) protected voidcallObservers(javafx.collections.MapChangeListener.Change<K, V> change) voidclear()booleancontainsKey(Object key) booleancontainsValue(@Nullable Object value) entrySet()@Nullable VbooleanisEmpty()keySet()@Nullable V@Nullable VvoidremoveListener(javafx.beans.InvalidationListener listener) voidremoveListener(javafx.collections.MapChangeListener<? super K, ? super V> observer) intsize()values()Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, merge, putAll, putIfAbsent, remove, replace, replace, replaceAllMethods inherited from interface javafx.beans.Observable
subscribe
-
Constructor Details
-
SharedKeysMap
Creates a new instance.- Parameters:
keyMap- a map which maps from keys to indices. The indices must be in the range[0,keyMap.size()-1].This map must be immutable.
-
-
Method Details
-
addListener
public void addListener(javafx.beans.InvalidationListener listener) - Specified by:
addListenerin interfacejavafx.beans.Observable
-
addListener
-
callObservers
-
clear
public void clear() -
containsKey
- Specified by:
containsKeyin interfaceMap<K,V> - Overrides:
containsKeyin classAbstractMap<K,V>
-
containsValue
- Specified by:
containsValuein interfaceMap<K,V> - Overrides:
containsValuein classAbstractMap<K,V>
-
entrySet
-
get
-
isEmpty
public boolean isEmpty() -
keySet
-
put
-
remove
-
removeListener
public void removeListener(javafx.beans.InvalidationListener listener) - Specified by:
removeListenerin interfacejavafx.beans.Observable
-
removeListener
-
size
public int size() -
values
-