java.lang.Object
java.util.AbstractMap<K,V>
org.jhotdraw8.fxbase.styleable.SimpleStyleableMap<K,V>
- Type Parameters:
K- key typeV- value type
- All Implemented Interfaces:
Map<K,,V> javafx.beans.Observable,javafx.collections.ObservableMap<K,,V> StyleableMap<K,V>
A map which stores its values in an array, and which can share its keys with
other SimpleStyleableMaps.
This map stores one distinct value for each StyleOrigin.
- 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
ConstructorsConstructorDescriptionCreates a new instance which supports insertion of new keys.SimpleStyleableMap(Map<K, Integer> keyMap) Creates a new instance which uses the provided key map. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddListener(javafx.beans.InvalidationListener listener) voidaddListener(javafx.collections.MapChangeListener<? super K, ? super V> observer) protected voidcallObservers(javafx.css.StyleOrigin origin, javafx.collections.MapChangeListener.Change<K, V> change) voidclear()Clears the map.booleancontainsKey(Object key) <T extends K>
booleancontainsKey(@Nullable javafx.css.StyleOrigin origin, T key) booleancontainsValue(Object value) booleancontainsValue(javafx.css.StyleOrigin origin, @Nullable Object value) entrySet()entrySet(@Nullable javafx.css.StyleOrigin origin) @Nullable V@Nullable VintgetMap(javafx.css.StyleOrigin origin) protected @Nullable VgetOrDefault(int originOrdinal, Object key, @Nullable V defaultValue) @Nullable VgetOrDefault(Object key, @Nullable V defaultValue) @Nullable VgetOrDefault(javafx.css.StyleOrigin origin, K key, @Nullable V defaultValue) @Nullable javafx.css.StyleOrigingetStyleOrigin(K key) booleanisEmpty()keySet()protected @Nullable V@Nullable V@Nullable V@Nullable VvoidremoveAll(javafx.css.StyleOrigin origin) Removes the specified key from the specified style origin and puts the provided defaulting method for the key in place.voidremoveListener(javafx.beans.InvalidationListener listener) voidremoveListener(javafx.collections.MapChangeListener<? super K, ? super V> observer) voidintsize()intsize(@Nullable javafx.css.StyleOrigin origin) 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, hashCode, merge, putAll, putIfAbsent, remove, replace, replace, replaceAllMethods inherited from interface javafx.beans.Observable
subscribe
-
Constructor Details
-
SimpleStyleableMap
public SimpleStyleableMap()Creates a new instance which supports insertion of new keys. -
SimpleStyleableMap
Creates a new instance which uses the provided key map.The key map can be shared with other instances, provided that the key map is immutable.
All entries in the key map must contain distinct integer values in the range [0, keyMap.size() - 1].
- Parameters:
keyMap- a map which maps from keys to indices. The indices must be in the range[0,keyMap.size()-1].
-
-
Method Details
-
entrySet
- Specified by:
entrySetin interfaceStyleableMap<K,V>
-
addListener
public void addListener(javafx.beans.InvalidationListener listener) - Specified by:
addListenerin interfacejavafx.beans.Observable
-
addListener
-
callObservers
-
clear
public void clear()Clears the map. -
containsKey
- Specified by:
containsKeyin interfaceMap<K,V> - Overrides:
containsKeyin classAbstractMap<K,V>
-
containsKey
- Specified by:
containsKeyin interfaceStyleableMap<K,V>
-
containsValue
- Specified by:
containsValuein interfaceMap<K,V> - Overrides:
containsValuein classAbstractMap<K,V>
-
containsValue
-
entrySet
-
get
-
getOrDefault
- Specified by:
getOrDefaultin interfaceMap<K,V>
-
get
- Specified by:
getin interfaceStyleableMap<K,V>
-
getOrDefault
-
getOrDefault
-
getMap
- Specified by:
getMapin interfaceStyleableMap<K,V>
-
getStyleOrigin
- Specified by:
getStyleOriginin interfaceStyleableMap<K,V>
-
removeKey
Description copied from interface:StyleableMapRemoves the specified key from the specified style origin and puts the provided defaulting method for the key in place.- Specified by:
removeKeyin interfaceStyleableMap<K,V> - Parameters:
origin- the style originkey- the key
-
getStyledMap
- Specified by:
getStyledMapin interfaceStyleableMap<K,V>
-
isEmpty
public boolean isEmpty() -
keySet
-
put
-
put
- Specified by:
putin interfaceStyleableMap<K,V>
-
put
-
remove
-
removeAll
public void removeAll(javafx.css.StyleOrigin origin) - Specified by:
removeAllin interfaceStyleableMap<K,V>
-
resetStyledValues
public void resetStyledValues()- Specified by:
resetStyledValuesin interfaceStyleableMap<K,V>
-
removeListener
public void removeListener(javafx.beans.InvalidationListener listener) - Specified by:
removeListenerin interfacejavafx.beans.Observable
-
removeListener
-
getIdentityHash
public int getIdentityHash() -
size
public int size() -
values
-
size
public int size(@Nullable javafx.css.StyleOrigin origin)
-