- 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
public abstract class SetExpression<E> extends Object implements ObservableSetValue<E>
SetExpression
is anObservableSetValue
plus additional convenience methods to generate bindings in a fluent style.A concrete sub-class of
SetExpression
has to implement the methodObservableObjectValue.get()
, which provides the actual value of this expression.If the wrapped list of a
SetExpression
isnull
, all methods implementing theSet
interface will behave as if they were applied to an immutable empty set.- Since:
- JavaFX 2.1
-
-
Property Summary
Properties Type Property Description abstract ReadOnlyBooleanProperty
empty
A boolean property that istrue
, if the set is empty.abstract ReadOnlyIntegerProperty
size
An integer property that represents the size of the set.
-
Constructor Summary
Constructors Constructor Description SetExpression()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description StringBinding
asString()
abstract ReadOnlyBooleanProperty
emptyProperty()
A boolean property that istrue
, if the set is empty.int
getSize()
The size of the setBooleanBinding
isEqualTo(ObservableSet<?> other)
BooleanBinding
isNotEqualTo(ObservableSet<?> other)
BooleanBinding
isNotNull()
BooleanBinding
isNull()
static <E> SetExpression<E>
setExpression(ObservableSetValue<E> value)
Returns aSetExpression
that wraps aObservableSetValue
.abstract ReadOnlyIntegerProperty
sizeProperty()
An integer property that represents the size of the set.-
Methods declared in interface java.util.Collection
parallelStream, removeIf, stream
-
Methods declared in class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
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, getValue, removeListener
-
-
-
-
Property Detail
-
size
public abstract ReadOnlyIntegerProperty sizeProperty
An integer property that represents the size of the set.- See Also:
getSize()
-
empty
public abstract ReadOnlyBooleanProperty emptyProperty
A boolean property that istrue
, if the set is empty.- See Also:
Set.isEmpty()
-
-
Method Detail
-
setExpression
public static <E> SetExpression<E> setExpression(ObservableSetValue<E> value)
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
public abstract ReadOnlyIntegerProperty sizeProperty()
An integer property that represents the size of the set.- See Also:
getSize()
-
emptyProperty
public abstract ReadOnlyBooleanProperty emptyProperty()
A boolean property that istrue
, if the set is empty.- See Also:
Set.isEmpty()
-
isEqualTo
public BooleanBinding isEqualTo(ObservableSet<?> other)
- Parameters:
other
- the otherObservableSet
- Returns:
- the new
BooleanBinding
- Throws:
NullPointerException
- ifother
isnull
-
isNotEqualTo
public BooleanBinding isNotEqualTo(ObservableSet<?> other)
- Parameters:
other
- the otherObservableSet
- Returns:
- the new
BooleanBinding
- Throws:
NullPointerException
- ifother
isnull
-
isNull
public BooleanBinding isNull()
- Returns:
- the new
BooleanBinding
-
isNotNull
public BooleanBinding isNotNull()
- Returns:
- the new
BooleanBinding
-
asString
public StringBinding 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
-
-