javafx.collections
Class SetChangeListener.Change<E>
- javafx.collections.SetChangeListener.Change<E>
Type Parameters:
E - element type
Enclosing interface:
public abstract static class SetChangeListener.Change<E> extends Object
An elementary change done to an ObservableSet. Change contains information about an add or remove operation. Note that adding element that is already in the set does not modify the set and hence no change will be generated.
Since:
JavaFX 2.1
-
Constructor Summary
Constructors Constructor and Description Change(ObservableSet<E> set)Constructs a change associated with a set.
-
Method Summary
All MethodsInstance MethodsAbstract MethodsConcrete Methods Modifier and Type Method and Description abstract EgetElementAdded()Get the new element.abstract EgetElementRemoved()Get the old element.ObservableSet<E>getSet()An observable set that is associated with the change.abstract booleanwasAdded()If this change is a result of add operation.abstract booleanwasRemoved()If this change is a result of removal operation.
-
Constructor Detail
-
Change
public Change(ObservableSet<E> set)
Constructs a change associated with a set.Parameters:
set- the source of the change
-
-
Method Detail
-
getSet
public ObservableSet<E> getSet()
An observable set that is associated with the change.Returns:
the source set
-
wasAdded
public abstract boolean wasAdded()
If this change is a result of add operation.Returns:
true if a new element was added to the set
-
wasRemoved
public abstract boolean wasRemoved()
If this change is a result of removal operation.Returns:
true if an old element was removed from the set
-
getElementAdded
public abstract E getElementAdded()
Get the new element. Return null if this is a removal.Returns:
the element that was just added
-
getElementRemoved
public abstract E getElementRemoved()
Get the old element. Return null if this is an addition.Returns:
the element that was just removed
-
© 2008, 2025, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from JavaFX API Documentation.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Java, JavaFX and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.