K
- the type of the key elementsV
- the type of the value elementspublic abstract class MapExpression<K,V>
extends java.lang.Object
MapExpression
is an
javafx.beans.value.ObservableMapValue
plus additional convenience
methods to generate bindings in a fluent style.
A concrete sub-class of MapExpression
has to implement the method
javafx.beans.value.ObservableMapValue#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.
|
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<<any>> |
entrySet() |
V |
get(java.lang.Object key) |
int |
getSize()
The size of the map
|
<any> |
getValue() |
boolean |
isEmpty()
Gets the value of the property empty.
|
BooleanBinding |
isEqualTo(<any> other)
Creates a new
BooleanBinding that holds true if this map is equal to
another javafx.collections.ObservableMap . |
BooleanBinding |
isNotEqualTo(<any> other)
Creates a new
BooleanBinding that holds true if this map is not equal to
another javafx.collections.ObservableMap . |
BooleanBinding |
isNotNull()
|
BooleanBinding |
isNull()
|
java.util.Set<K> |
keySet() |
static <K,V> MapExpression<K,V> |
mapExpression(<any> value)
Returns a
MapExpression that wraps a
javafx.beans.value.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(<any> key)
Creates a new
ObjectBinding that contains the mapping of the specified key. |
ObjectBinding<V> |
valueAt(K key)
Creates a new
ObjectBinding that contains the mapping of the specified key. |
java.util.Collection<V> |
values() |
public abstract ReadOnlyIntegerProperty sizeProperty
getSize()
public abstract ReadOnlyBooleanProperty emptyProperty
true
, if the map is empty.isEmpty()
public <any> getValue()
public static <K,V> MapExpression<K,V> mapExpression(<any> value)
MapExpression
that wraps a
javafx.beans.value.ObservableMapValue
. If the
ObservableMapValue
is already a MapExpression
, it
will be returned. Otherwise a new
MapBinding
is created that is bound to
the ObservableMapValue
.K
- the type of the key elementsV
- the type of the value elementsvalue
- The source ObservableMapValue
MapExpression
that wraps the
ObservableMapValue
if necessaryjava.lang.NullPointerException
- if value
is null
public 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 mappingObjectBinding
public ObjectBinding<V> valueAt(<any> key)
ObjectBinding
that contains the mapping of the specified key.key
- the key of the mappingObjectBinding
java.lang.NullPointerException
- if key
is null
public BooleanBinding isEqualTo(<any> other)
BooleanBinding
that holds true
if this map is equal to
another javafx.collections.ObservableMap
.other
- the other ObservableMap
BooleanBinding
java.lang.NullPointerException
- if other
is null
public BooleanBinding isNotEqualTo(<any> other)
BooleanBinding
that holds true
if this map is not equal to
another javafx.collections.ObservableMap
.other
- the other ObservableMap
BooleanBinding
java.lang.NullPointerException
- if other
is null
public BooleanBinding isNull()
BooleanBinding
public BooleanBinding isNotNull()
BooleanBinding
public 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.StringBinding
public int size()
public boolean isEmpty()
public boolean containsKey(java.lang.Object obj)
public boolean containsValue(java.lang.Object obj)
public V remove(java.lang.Object obj)
public void clear()
public java.util.Set<K> keySet()
public java.util.Collection<V> values()
public java.util.Set<<any>> entrySet()
public V get(java.lang.Object key)