K - the type of the key elementsV - the type of the value elementspublic abstract class MapExpression<K,V> extends java.lang.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.
| Modifier and Type | Class and Description |
|---|---|
private static class |
MapExpression.EmptyObservableMap<K,V> |
| Modifier and Type | Field and Description |
|---|---|
private static ObservableMap |
EMPTY_MAP |
| Constructor and Description |
|---|
MapExpression() |
| Modifier and Type | Method and Description |
|---|---|
StringBinding |
asString()
|
void |
clear() |
boolean |
containsKey(java.lang.Object obj) |
boolean |
containsValue(java.lang.Object obj) |
abstract ReadOnlyBooleanProperty |
emptyProperty()
A boolean property that is
true, if the map is empty. |
java.util.Set<java.util.Map.Entry<K,V>> |
entrySet() |
V |
get(java.lang.Object key) |
int |
getSize()
The size of the map
|
ObservableMap<K,V> |
getValue()
Returns the current value of this
ObservableValue |
boolean |
isEmpty() |
BooleanBinding |
isEqualTo(ObservableMap<?,?> other)
|
BooleanBinding |
isNotEqualTo(ObservableMap<?,?> other)
|
BooleanBinding |
isNotNull()
|
BooleanBinding |
isNull()
|
java.util.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(java.util.Map<? extends K,? extends V> elements) |
V |
remove(java.lang.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. |
java.util.Collection<V> |
values() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetaddListener, removeListeneraddListener, removeListeneraddListener, removeListenerprivate static final ObservableMap EMPTY_MAP
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 necessaryjava.lang.NullPointerException - if value is nullpublic int getSize()
public abstract ReadOnlyIntegerProperty sizeProperty()
public abstract ReadOnlyBooleanProperty emptyProperty()
true, if the map is empty.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 mappingObjectBindingjava.lang.NullPointerException - if key is nullpublic BooleanBinding isEqualTo(ObservableMap<?,?> other)
other - the other ObservableMapBooleanBindingjava.lang.NullPointerException - if other is nullpublic BooleanBinding isNotEqualTo(ObservableMap<?,?> other)
other - the other ObservableMapBooleanBindingjava.lang.NullPointerException - 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 containsKey(java.lang.Object obj)
public boolean containsValue(java.lang.Object obj)