Class SimpleSetProperty<E>
java.lang.Object
javafx.beans.binding.SetExpression<E>
javafx.beans.property.ReadOnlySetProperty<E>
javafx.beans.property.SetProperty<E>
javafx.beans.property.SetPropertyBase<E>
javafx.beans.property.SimpleSetProperty<E>
- Type Parameters:
E- the type of theSetelements
- All Implemented Interfaces:
Iterable<E>, Collection<E>, Set<E>, Observable, Property<ObservableSet<E>>, ReadOnlyProperty<ObservableSet<E>>, ObservableObjectValue<ObservableSet<E>>, ObservableSetValue<E>, ObservableValue<ObservableSet<E>>, WritableObjectValue<ObservableSet<E>>, WritableSetValue<E>, WritableValue<ObservableSet<E>>, ObservableSet<E>
- Direct Known Subclasses:
ReadOnlySetWrapper
This class provides a full implementation of a
Property wrapping an
ObservableSet.- Since:
- JavaFX 2.1
- See Also:
-
Property Summary
Properties declared in class SetPropertyBase
empty, sizeTypePropertyDescriptionA boolean property that istrue, if the set is empty.An integer property that represents the size of the set. -
Constructor Summary
ConstructorsConstructorDescriptionThe constructor ofSimpleSetPropertySimpleSetProperty(Object bean, String name) The constructor ofSimpleSetPropertySimpleSetProperty(Object bean, String name, ObservableSet<E> initialValue) The constructor ofSimpleSetPropertySimpleSetProperty(ObservableSet<E> initialValue) The constructor ofSimpleSetProperty -
Method Summary
Methods declared in class SetPropertyBase
addListener, addListener, addListener, bind, emptyProperty, fireValueChangedEvent, fireValueChangedEvent, get, invalidated, isBound, removeListener, removeListener, removeListener, set, sizeProperty, toString, unbindModifier and TypeMethodDescriptionvoidaddListener(InvalidationListener listener) Adds anInvalidationListenerwhich will be notified whenever theObservablebecomes invalid.voidaddListener(ChangeListener<? super ObservableSet<E>> listener) Adds aChangeListenerwhich will be notified whenever the value of theObservableValuechanges.voidaddListener(SetChangeListener<? super E> listener) Add a listener to this observable set.voidbind(ObservableValue<? extends ObservableSet<E>> newObservable) Create a unidirection binding for thisProperty.A boolean property that istrue, if the set is empty.protected voidprotected voidfireValueChangedEvent(SetChangeListener.Change<? extends E> change) get()Returns the current value of thisObservableObjectValue<T>.protected voidThe methodinvalidated()can be overridden to receive invalidation notifications.booleanisBound()Can be used to check, if aPropertyis bound.voidremoveListener(InvalidationListener listener) Removes the given listener from the list of listeners, that are notified whenever the value of theObservablebecomes invalid.voidremoveListener(ChangeListener<? super ObservableSet<E>> listener) Removes the given listener from the list of listeners that are notified whenever the value of theObservableValuechanges.voidremoveListener(SetChangeListener<? super E> listener) Tries to removed a listener from this observable set.voidset(ObservableSet<E> newValue) Set the wrapped value.An integer property that represents the size of the set.toString()Returns a string representation of thisSetPropertyBaseobject.voidunbind()Remove the unidirectional binding for thisProperty.Methods declared in class SetProperty
bindBidirectional, setValue, unbindBidirectionalModifier and TypeMethodDescriptionvoidbindBidirectional(Property<ObservableSet<E>> other) Create a bidirectional binding between thisPropertyand another one.voidsetValue(ObservableSet<E> v) Set the wrapped value.voidunbindBidirectional(Property<ObservableSet<E>> other) Removes a bidirectional binding between thisPropertyand another one.Methods declared in class ReadOnlySetProperty
bindContent, bindContentBidirectional, equals, hashCode, unbindContent, unbindContentBidirectionalModifier and TypeMethodDescriptionvoidbindContent(ObservableSet<E> set) Creates a content binding between theObservableSet, that is wrapped in thisReadOnlySetProperty, and anotherObservableSet.voidCreates a bidirectional content binding of theObservableSet, that is wrapped in thisReadOnlySetProperty, and anotherObservableSet.booleaninthashCode()Returns a hash code for thisReadOnlySetPropertyobject.voidunbindContent(Object object) Deletes a content binding between theObservableSet, that is wrapped in thisReadOnlySetProperty, and anotherObject.voidunbindContentBidirectional(Object object) Deletes a bidirectional content binding between theObservableSet, that is wrapped in thisReadOnlySetProperty, and anotherObject.Methods declared in class SetExpression
add, addAll, asString, clear, contains, containsAll, getSize, getValue, isEmpty, isEqualTo, isNotEqualTo, isNotNull, isNull, iterator, remove, removeAll, retainAll, setExpression, size, toArray, toArrayModifier and TypeMethodDescriptionbooleanbooleanaddAll(Collection<? extends E> elements) asString()voidclear()booleanbooleancontainsAll(Collection<?> objects) intgetSize()The size of the setgetValue()Returns the current value of thisObservableValuebooleanisEmpty()Gets the value of theemptyproperty.isEqualTo(ObservableSet<?> other) isNotEqualTo(ObservableSet<?> other) isNull()iterator()booleanbooleanremoveAll(Collection<?> objects) booleanretainAll(Collection<?> objects) static <E> SetExpression<E> setExpression(ObservableSetValue<E> value) Returns aSetExpressionthat wraps aObservableSetValue.intsize()Object[]toArray()<T> T[]toArray(T[] array) Methods declared in class Object
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, waitMethods declared in interface Collection
parallelStream, removeIf, stream, toArrayMethods declared in interface Observable
subscribeModifier and TypeMethodDescriptiondefault SubscriptionCreates aSubscriptionon thisObservablewhich callsinvalidationSubscriberwhenever it becomes invalid.Methods declared in interface ObservableValue
flatMap, map, orElse, subscribe, subscribe, whenModifier and TypeMethodDescriptiondefault <U> ObservableValue<U> flatMap(Function<? super ObservableSet<E>, ? extends ObservableValue<? extends U>> mapper) Returns anObservableValuethat holds the value of anObservableValueproduced by applying the given mapping function on this value.default <U> ObservableValue<U> map(Function<? super ObservableSet<E>, ? extends U> mapper) Returns anObservableValuethat holds the result of applying the given mapping function on this value.default ObservableValue<ObservableSet<E>> orElse(ObservableSet<E> constant) Returns anObservableValuethat holds this value, or the given constant if it isnull.default Subscriptionsubscribe(BiConsumer<? super ObservableSet<E>, ? super ObservableSet<E>> changeSubscriber) Creates aSubscriptionon thisObservableValuewhich calls the givenchangeSubscriberwith the old and new value whenever its value changes.default Subscriptionsubscribe(Consumer<? super ObservableSet<E>> valueSubscriber) Creates aSubscriptionon thisObservableValuewhich immediately provides the current value to the givenvalueSubscriber, followed by any subsequent values whenever its value changes.default ObservableValue<ObservableSet<E>> when(ObservableValue<Boolean> condition) Returns anObservableValuethat holds this value and is updated only whenconditionholdstrue.Methods declared in interface Set
spliteratorMethods declared in interface WritableValue
getValue
-
Constructor Details
-
SimpleSetProperty
public SimpleSetProperty()The constructor ofSimpleSetProperty -
SimpleSetProperty
The constructor ofSimpleSetProperty- Parameters:
initialValue- the initial value of the wrapped value
-
SimpleSetProperty
-
SimpleSetProperty
The constructor ofSimpleSetProperty- Parameters:
bean- the bean of thisSetPropertyname- the name of thisSetPropertyinitialValue- the initial value of the wrapped value
-
-
Method Details
-
getBean
Returns theObjectthat contains this property. If this property is not contained in anObject,nullis returned.- Returns:
- the containing
Objectornull
-
getName
Returns the name of this property. If the property does not have a name, this method returns an emptyString.- Returns:
- the name or an empty
String
-