K - the type of the key elementsV - the type of the value elementspublic abstract class MapExpression<K,V> extends Object implements ObservableMapValue<K,V>
MapExpression is a
ObservableMapValue plus additional convenience
methods to generate bindings in a fluent style.
A concrete sub-class of MapExpression has to implement the method
ObservableObjectValue.get(), which provides the
actual value of this expression.
If the wrapped list of a MapExpression is null, all methods implementing the Map
interface will behave as if they were applied to an immutable empty list.
| Type | Property and Description |
|---|---|
abstract ReadOnlyBooleanProperty |
empty
A boolean property that is
true, if the map is empty. |
abstract ReadOnlyIntegerProperty |
size
An integer property that represents the size of the map.
|
| Constructor and Description |
|---|
MapExpression() |
| Modifier and Type | Method and Description |
|---|---|
StringBinding |
asString()
|
void |
clear() |
boolean |
containsKey(Object obj) |
boolean |
containsValue(Object obj) |
abstract ReadOnlyBooleanProperty |
emptyProperty()
A boolean property that is
true, if the map is empty. |
Set<Map.Entry<K,V>> |
entrySet() |
V |
get(Object key) |
int |
getSize()
The size of the map
|
ObservableMap<K,V> |
getValue()
Returns the current value of this
ObservableValue |
boolean |
isEmpty()
Gets the value of the property empty.
|
BooleanBinding |
isEqualTo(ObservableMap<?,?> other)
|
BooleanBinding |
isNotEqualTo(ObservableMap<?,?> other)
|
BooleanBinding |
isNotNull()
|
BooleanBinding |
isNull()
|
Set<K> |
keySet() |
static <K,V> MapExpression<K,V> |
mapExpression(ObservableMapValue<K,V> value)
Returns a
MapExpression that wraps a
ObservableMapValue. |
V |
put(K key,
V value) |
void |
putAll(Map<? extends K,? extends V> elements) |
V |
remove(Object obj) |
int |
size() |
abstract ReadOnlyIntegerProperty |
sizeProperty()
An integer property that represents the size of the map.
|
ObjectBinding<V> |
valueAt(K key)
Creates a new
ObjectBinding that contains the mapping of the specified key. |
ObjectBinding<V> |
valueAt(ObservableValue<K> key)
Creates a new
ObjectBinding that contains the mapping of the specified key. |
Collection<V> |
values() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetaddListener, removeListeneraddListener, removeListeneraddListener, removeListenercompute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAllpublic abstract ReadOnlyIntegerProperty sizeProperty
getSize()public abstract ReadOnlyBooleanProperty emptyProperty
true, if the map is empty.isEmpty()public ObservableMap<K,V> getValue()
ObservableValueObservableValuegetValue in interface ObservableValue<ObservableMap<K,V>>public static <K,V> MapExpression<K,V> mapExpression(ObservableMapValue<K,V> value)
MapExpression that wraps a
ObservableMapValue. If the
ObservableMapValue is already a MapExpression, it
will be returned. Otherwise a new
MapBinding is created that is bound to
the ObservableMapValue.value - The source ObservableMapValueMapExpression that wraps the
ObservableMapValue if necessaryNullPointerException - if value is nullpublic int getSize()
public abstract ReadOnlyIntegerProperty sizeProperty()
getSize()public abstract ReadOnlyBooleanProperty emptyProperty()
true, if the map is empty.isEmpty()public ObjectBinding<V> valueAt(K key)
ObjectBinding that contains the mapping of the specified key.key - the key of the mappingObjectBindingpublic ObjectBinding<V> valueAt(ObservableValue<K> key)
ObjectBinding that contains the mapping of the specified key.key - the key of the mappingObjectBindingNullPointerException - if key is nullpublic BooleanBinding isEqualTo(ObservableMap<?,?> other)
other - the other ObservableMapBooleanBindingNullPointerException - if other is nullpublic BooleanBinding isNotEqualTo(ObservableMap<?,?> other)
other - the other ObservableMapBooleanBindingNullPointerException - if other is nullpublic BooleanBinding isNull()
BooleanBindingpublic BooleanBinding isNotNull()
BooleanBindingpublic StringBinding asString()
StringBinding that holds the value
of the MapExpression turned into a String. If the
value of this MapExpression changes, the value of the
StringBinding will be updated automatically.StringBindingpublic boolean isEmpty()
public boolean containsKey(Object obj)
containsKey in interface Map<K,V>public boolean containsValue(Object obj)
containsValue in interface Map<K,V>Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.