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.
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() |
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, wait
get
addListener, removeListener
addListener, removeListener
addListener, removeListener
compute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAll
public ObservableMap<K,V> getValue()
ObservableValue
ObservableValue
getValue
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 ObservableMapValue
MapExpression
that wraps the
ObservableMapValue
if necessaryNullPointerException
- if value
is null
public 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 mappingObjectBinding
public ObjectBinding<V> valueAt(ObservableValue<K> key)
ObjectBinding
that contains the mapping of the specified key.key
- the key of the mappingObjectBinding
NullPointerException
- if key
is null
public BooleanBinding isEqualTo(ObservableMap<?,?> other)
other
- the other ObservableMap
BooleanBinding
NullPointerException
- if other
is null
public BooleanBinding isNotEqualTo(ObservableMap<?,?> other)
other
- the other ObservableMap
BooleanBinding
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 boolean containsKey(Object obj)
containsKey
in interface Map<K,V>
public boolean containsValue(Object obj)
containsValue
in interface Map<K,V>
Copyright © 2020. All rights reserved.