java.lang.Object
javafx.beans.binding.SetExpression<E>
- Type Parameters:
E- the type of theSetelements
- 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 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
Properties Type Property Description abstract ReadOnlyBooleanPropertyemptyA boolean property that istrue, if the set is empty.abstract ReadOnlyIntegerPropertysizeAn integer property that represents the size of the set. -
Constructor Summary
Constructors Constructor Description SetExpression()Creates a defaultSetExpression. -
Method Summary
Modifier and Type Method Description booleanadd(E element)booleanaddAll(Collection<? extends E> elements)StringBindingasString()voidclear()booleancontains(Object obj)booleancontainsAll(Collection<?> objects)abstract ReadOnlyBooleanPropertyemptyProperty()A boolean property that istrue, if the set is empty.intgetSize()The size of the setObservableSet<E>getValue()Returns the current value of thisObservableValuebooleanisEmpty()Gets the value of the property empty.BooleanBindingisEqualTo(ObservableSet<?> other)BooleanBindingisNotEqualTo(ObservableSet<?> other)BooleanBindingisNotNull()BooleanBindingisNull()Iterator<E>iterator()booleanremove(Object obj)booleanremoveAll(Collection<?> objects)booleanretainAll(Collection<?> objects)static <E> SetExpression<E>setExpression(ObservableSetValue<E> value)Returns aSetExpressionthat wraps aObservableSetValue.intsize()abstract ReadOnlyIntegerPropertysizeProperty()An integer property that represents the size of the set.Object[]toArray()<T> T[]toArray(T[] array)Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArrayMethods inherited from interface javafx.beans.Observable
addListener, removeListenerMethods inherited from interface javafx.beans.value.ObservableObjectValue
getMethods inherited from interface javafx.collections.ObservableSet
addListener, removeListenerMethods inherited from interface javafx.beans.value.ObservableValue
addListener, removeListenerMethods inherited from interface java.util.Set
equals, hashCode, spliterator
-
Property Details
-
Constructor Details
-
SetExpression
public SetExpression()Creates a defaultSetExpression.
-
-
Method Details
-
getValue
Description copied from interface:ObservableValueReturns the current value of thisObservableValue- Specified by:
getValuein interfaceObservableValue<E>- Returns:
- The current value
-
setExpression
Returns aSetExpressionthat wraps aObservableSetValue. If theObservableSetValueis already aSetExpression, it will be returned. Otherwise a newSetBindingis created that is bound to theObservableSetValue.- Type Parameters:
E- the type of theSetelements- Parameters:
value- The sourceObservableSetValue- Returns:
- A
SetExpressionthat wraps theObservableSetValueif necessary - Throws:
NullPointerException- ifvalueisnull
-
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:
getSize()
-
emptyProperty
A boolean property that istrue, if the set is empty.- See Also:
isEmpty()
-
isEqualTo
- Parameters:
other- the otherObservableSet- Returns:
- the new
BooleanBinding - Throws:
NullPointerException- ifotherisnull
-
isNotEqualTo
- Parameters:
other- the otherObservableSet- Returns:
- the new
BooleanBinding - Throws:
NullPointerException- ifotherisnull
-
isNull
- Returns:
- the new
BooleanBinding
-
isNotNull
- Returns:
- the new
BooleanBinding
-
asString
Creates aStringBindingthat holds the value of theSetExpressionturned into aString. If the value of thisSetExpressionchanges, the value of theStringBindingwill 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:
containsAllin interfaceCollection<E>- Specified by:
containsAllin interfaceSet<E>
-
addAll
-
removeAll
-
retainAll
-
clear
public void clear()
-