java.lang.Object
javafx.collections.SetChangeListener.Change<E>
- Type Parameters:
E
- element type
- Enclosing interface:
SetChangeListener<E>
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
-
Method Summary
Modifier and TypeMethodDescriptionabstract E
Get the new element.abstract E
Get the old element.getSet()
An observable set that is associated with the change.abstract boolean
wasAdded()
If this change is a result of add operation.abstract boolean
If this change is a result of removal operation.
-
Constructor Details
-
Change
Constructs a change associated with a set.- Parameters:
set
- the source of the change
-
-
Method Details
-
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
Get the new element. Return null if this is a removal.- Returns:
- the element that was just added
-
getElementRemoved
Get the old element. Return null if this is an addition.- Returns:
- the element that was just removed
-