Package com.sun.javafx.collections
Class SourceAdapterChange<E>
java.lang.Object
javafx.collections.ListChangeListener.Change<E>
com.sun.javafx.collections.SourceAdapterChange<E>
-
Constructor Summary
ConstructorsConstructorDescriptionSourceAdapterChange
(ObservableList<E> list, ListChangeListener.Change<? extends E> change) -
Method Summary
Modifier and TypeMethodDescriptionint
getFrom()
If wasAdded is true, the interval contains all the values that were added.protected int[]
If this change is an permutation, it returns an integer array that describes the permutation.An immutable list of removed/replaced elements.int
getTo()
The end of the change interval.boolean
next()
Go to the next change.void
reset()
Reset to the initial stage.toString()
boolean
Indicates that the elements between getFrom() (inclusive) to getTo() exclusive has changed.Methods inherited from class javafx.collections.ListChangeListener.Change
getAddedSize, getAddedSubList, getList, getPermutation, getRemovedSize, wasAdded, wasPermutated, wasRemoved, wasReplaced
-
Constructor Details
-
SourceAdapterChange
-
-
Method Details
-
next
public boolean next()Description copied from class:ListChangeListener.Change
Go to the next change. The Change in the initial state is invalid a requires a call to next() before calling other methods. The first next() call will make this object represent the first change.- Specified by:
next
in classListChangeListener.Change<E>
- Returns:
- true if switched to the next change, false if this is the last change.
-
reset
public void reset()Description copied from class:ListChangeListener.Change
Reset to the initial stage. After this call, the next() must be called before working with the first change.- Specified by:
reset
in classListChangeListener.Change<E>
-
getTo
public int getTo()Description copied from class:ListChangeListener.Change
The end of the change interval.- Specified by:
getTo
in classListChangeListener.Change<E>
- Returns:
- a end (exclusive) of an interval related to the change.
- See Also:
-
getRemoved
Description copied from class:ListChangeListener.Change
An immutable list of removed/replaced elements. If no elements were removed from the list, an empty list is returned.- Specified by:
getRemoved
in classListChangeListener.Change<E>
- Returns:
- a list with all the removed elements
-
getFrom
public int getFrom()Description copied from class:ListChangeListener.Change
If wasAdded is true, the interval contains all the values that were added. If wasPermutated is true, the interval marks the values that were permutated. If wasRemoved is true and wasAdded is false, getFrom() and getTo() should return the same number - the place where the removed elements were positioned in the list.- Specified by:
getFrom
in classListChangeListener.Change<E>
- Returns:
- a beginning (inclusive) of an interval related to the change
-
wasUpdated
public boolean wasUpdated()Description copied from class:ListChangeListener.Change
Indicates that the elements between getFrom() (inclusive) to getTo() exclusive has changed. This is the only optional event type and may not be fired by all ObservableLists.- Overrides:
wasUpdated
in classListChangeListener.Change<E>
- Returns:
- true if the current change is an update change.
-
getPermutation
protected int[] getPermutation()Description copied from class:ListChangeListener.Change
If this change is an permutation, it returns an integer array that describes the permutation. This array maps directly from the previous indexes to the new ones. This method is not publicly accessible and therefore can return an array safely. The 0 index of the array corresponds to indexListChangeListener.Change.getFrom()
of the list. The same applies for the last index andListChangeListener.Change.getTo()
. The method is used byListChangeListener.Change.wasPermutated()
andListChangeListener.Change.getPermutation(int)
methods.- Specified by:
getPermutation
in classListChangeListener.Change<E>
- Returns:
- empty array if this is not permutation or an integer array containing the permutation
-
toString
-