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 TypeMethodDescriptionintgetFrom()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.intgetTo()The end of the change interval.booleannext()Go to the next change.voidreset()Reset to the initial stage.toString()booleanIndicates 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.ChangeGo 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:
nextin 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.ChangeReset to the initial stage. After this call, the next() must be called before working with the first change.- Specified by:
resetin classListChangeListener.Change<E>
-
getTo
public int getTo()Description copied from class:ListChangeListener.ChangeThe end of the change interval.- Specified by:
getToin classListChangeListener.Change<E>- Returns:
- a end (exclusive) of an interval related to the change.
- See Also:
-
getRemoved
Description copied from class:ListChangeListener.ChangeAn immutable list of removed/replaced elements. If no elements were removed from the list, an empty list is returned.- Specified by:
getRemovedin classListChangeListener.Change<E>- Returns:
- a list with all the removed elements
-
getFrom
public int getFrom()Description copied from class:ListChangeListener.ChangeIf 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:
getFromin classListChangeListener.Change<E>- Returns:
- a beginning (inclusive) of an interval related to the change
-
wasUpdated
public boolean wasUpdated()Description copied from class:ListChangeListener.ChangeIndicates 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:
wasUpdatedin classListChangeListener.Change<E>- Returns:
- true if the current change is an update change.
-
getPermutation
protected int[] getPermutation()Description copied from class:ListChangeListener.ChangeIf 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:
getPermutationin classListChangeListener.Change<E>- Returns:
- empty array if this is not permutation or an integer array containing the permutation
-
toString
-