- java.lang.Object
- 
- javafx.beans.binding.SetExpression<E>
 
- 
- Type Parameters:
- E- the type of the- Setelements
 - 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> SetExpressionis anObservableSetValueplus additional convenience methods to generate bindings in a fluent style.A concrete sub-class of SetExpressionhas to implement the methodObservableObjectValue.get(), which provides the actual value of this expression.If the wrapped list of a SetExpressionisnull, all methods implementing theSetinterface will behave as if they were applied to an immutable empty set.- Since:
- JavaFX 2.1
 
- 
- 
Property SummaryProperties 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 SummaryConstructors Constructor Description SetExpression()
 - 
Method SummaryModifier 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.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 - 
Methods inherited from interface java.util.CollectionparallelStream, removeIf, stream, toArray
 - 
Methods inherited from interface javafx.beans.ObservableaddListener, removeListener
 - 
Methods inherited from interface javafx.beans.value.ObservableObjectValueget
 - 
Methods inherited from interface javafx.collections.ObservableSetaddListener, removeListener
 - 
Methods inherited from interface javafx.beans.value.ObservableValueaddListener, removeListener
 - 
Methods inherited from interface java.util.Setequals, hashCode, spliterator
 
- 
 
- 
- 
- 
Property Detail- 
sizepublic abstract ReadOnlyIntegerProperty sizeProperty An integer property that represents the size of the set.- See Also:
- getSize()
 
 - 
emptypublic abstract ReadOnlyBooleanProperty emptyProperty A boolean property that istrue, if the set is empty.- See Also:
- isEmpty()
 
 
- 
 - 
Method Detail- 
getValuepublic ObservableSet<E> getValue() Description copied from interface:ObservableValueReturns the current value of thisObservableValue- Specified by:
- getValuein interface- ObservableValue<E>
- Returns:
- The current value
 
 - 
setExpressionpublic static <E> SetExpression<E> setExpression(ObservableSetValue<E> value) 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 the- Setelements
- Parameters:
- value- The source- ObservableSetValue
- Returns:
- A SetExpressionthat wraps theObservableSetValueif necessary
- Throws:
- NullPointerException- if- valueis- null
 
 - 
getSizepublic int getSize() The size of the set- Returns:
- the size
 
 - 
sizePropertypublic abstract ReadOnlyIntegerProperty sizeProperty() An integer property that represents the size of the set.- See Also:
- getSize()
 
 - 
emptyPropertypublic abstract ReadOnlyBooleanProperty emptyProperty() A boolean property that istrue, if the set is empty.- See Also:
- isEmpty()
 
 - 
isEqualTopublic BooleanBinding isEqualTo(ObservableSet<?> other) - Parameters:
- other- the other- ObservableSet
- Returns:
- the new BooleanBinding
- Throws:
- NullPointerException- if- otheris- null
 
 - 
isNotEqualTopublic BooleanBinding isNotEqualTo(ObservableSet<?> other) - Parameters:
- other- the other- ObservableSet
- Returns:
- the new BooleanBinding
- Throws:
- NullPointerException- if- otheris- null
 
 - 
isNullpublic BooleanBinding isNull() - Returns:
- the new BooleanBinding
 
 - 
isNotNullpublic BooleanBinding isNotNull() - Returns:
- the new BooleanBinding
 
 - 
asStringpublic StringBinding 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
 
 - 
sizepublic int size() 
 - 
isEmptypublic boolean isEmpty() Gets the value of the property empty.
 - 
containspublic boolean contains(Object obj) 
 - 
toArraypublic Object[] toArray() 
 - 
toArraypublic <T> T[] toArray(T[] array) 
 - 
addpublic boolean add(E element) 
 - 
removepublic boolean remove(Object obj) 
 - 
containsAllpublic boolean containsAll(Collection<?> objects) - Specified by:
- containsAllin interface- Collection<E>
- Specified by:
- containsAllin interface- Set<E>
 
 - 
addAllpublic boolean addAll(Collection<? extends E> elements) 
 - 
removeAllpublic boolean removeAll(Collection<?> objects) 
 - 
retainAllpublic boolean retainAll(Collection<?> objects) 
 
- 
 
-