java.lang.Object
javafx.beans.binding.SetExpression<E>
- Type Parameters:
E
- the type of theSet
elements
- All Implemented Interfaces:
Iterable<E>
,Collection<E>
,Set<E>
,Observable
,ObservableObjectValue<ObservableSet<E>>
,ObservableSetValue<E>
,ObservableValue<ObservableSet<E>>
,ObservableSet<E>
- Direct Known Subclasses:
ReadOnlySetProperty
,SetBinding
SetExpression
is an
ObservableSetValue
plus additional convenience
methods to generate bindings in a fluent style.
A concrete sub-class of SetExpression
has to implement the method
ObservableObjectValue.get()
, which provides the
actual value of this expression.
If the wrapped list of a SetExpression
is null
, all methods implementing the Set
interface will behave as if they were applied to an immutable empty set.
- Since:
- JavaFX 2.1
-
Property Summary
TypePropertyDescriptionabstract ReadOnlyBooleanProperty
A boolean property that istrue
, if the set is empty.abstract ReadOnlyIntegerProperty
An integer property that represents the size of the set. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
boolean
addAll
(Collection<? extends E> elements) asString()
void
clear()
boolean
boolean
containsAll
(Collection<?> objects) abstract ReadOnlyBooleanProperty
A boolean property that istrue
, if the set is empty.int
getSize()
The size of the setgetValue()
Returns the current value of thisObservableValue
boolean
isEmpty()
Gets the value of the property empty.isEqualTo
(ObservableSet<?> other) isNotEqualTo
(ObservableSet<?> other) isNull()
iterator()
boolean
boolean
removeAll
(Collection<?> objects) boolean
retainAll
(Collection<?> objects) static <E> SetExpression<E>
setExpression
(ObservableSetValue<E> value) Returns aSetExpression
that wraps aObservableSetValue
.int
size()
abstract ReadOnlyIntegerProperty
An integer property that represents the size of the set.Object[]
toArray()
<T> T[]
toArray
(T[] array) Methods declared in class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods declared in interface java.util.Collection
parallelStream, removeIf, stream, toArray
Methods declared in interface javafx.beans.Observable
addListener, removeListener
Methods declared in interface javafx.beans.value.ObservableObjectValue
get
Methods declared in interface javafx.collections.ObservableSet
addListener, removeListener
Methods declared in interface javafx.beans.value.ObservableValue
addListener, removeListener
Methods declared in interface java.util.Set
equals, hashCode, spliterator
-
Property Details
-
Constructor Details
-
SetExpression
public SetExpression()Creates a defaultSetExpression
.
-
-
Method Details
-
getValue
Description copied from interface:ObservableValue
Returns the current value of thisObservableValue
- Specified by:
getValue
in interfaceObservableValue<E>
- Returns:
- The current value
-
setExpression
Returns aSetExpression
that wraps aObservableSetValue
. If theObservableSetValue
is already aSetExpression
, it will be returned. Otherwise a newSetBinding
is created that is bound to theObservableSetValue
.- Type Parameters:
E
- the type of theSet
elements- Parameters:
value
- The sourceObservableSetValue
- Returns:
- A
SetExpression
that wraps theObservableSetValue
if necessary - Throws:
NullPointerException
- ifvalue
isnull
-
getSize
public int getSize()The size of the set- Returns:
- the size
-
sizeProperty
An integer property that represents the size of the set.- See Also:
-
emptyProperty
A boolean property that istrue
, if the set is empty.- See Also:
-
isEqualTo
- Parameters:
other
- the otherObservableSet
- Returns:
- the new
BooleanBinding
- Throws:
NullPointerException
- ifother
isnull
-
isNotEqualTo
- Parameters:
other
- the otherObservableSet
- Returns:
- the new
BooleanBinding
- Throws:
NullPointerException
- ifother
isnull
-
isNull
- Returns:
- the new
BooleanBinding
-
isNotNull
- Returns:
- the new
BooleanBinding
-
asString
Creates aStringBinding
that holds the value of theSetExpression
turned into aString
. If the value of thisSetExpression
changes, the value of theStringBinding
will be updated automatically.- Returns:
- the new
StringBinding
-
size
public int size() -
isEmpty
public boolean isEmpty()Gets the value of the property empty. -
contains
-
iterator
-
toArray
-
toArray
public <T> T[] toArray(T[] array) -
add
-
remove
-
containsAll
- Specified by:
containsAll
in interfaceCollection<E>
- Specified by:
containsAll
in interfaceSet<E>
-
addAll
-
removeAll
-
retainAll
-
clear
public void clear()
-