Top Fields Constructors Methods
com.sun.javafx.collections

public final Class MappingChange<E, F>

extends ListChangeListener.Change<F>
Class Inheritance
Imports
java.util.AbstractList, .List, java.util.function.Function, javafx.collections.ListChangeListener.Change, .ObservableList

Field Summary

Modifier and TypeField and Description
private final Function<E, F>
private final ListChangeListener.Change<? extends E>
private List<F>

Constructor Summary

AccessConstructor and Description
public
MappingChange(ListChangeListener.Change<? extends E> original, Function<E, F> mapper, ObservableList<F> list)

Method Summary

Modifier and TypeMethod and Description
public int
getFrom()

Implements abstract javafx.collections.ListChangeListener.Change.getFrom.

If wasAdded() is true, the interval contains all the values that were added.

protected int[]
getPermutation()

Implements abstract javafx.collections.ListChangeListener.Change.getPermutation.

If this change is a permutation, it returns an integer array that describes the permutation.

public int
getPermutation(int
the old index that contained the element prior to this change
i
)

Overrides javafx.collections.ListChangeListener.Change.getPermutation.

This method allows developers to observe the permutations that occurred in this change.

public List<F>
getRemoved()

Implements abstract javafx.collections.ListChangeListener.Change.getRemoved.

An immutable list of removed/replaced elements.

public int
getTo()

Implements abstract javafx.collections.ListChangeListener.Change.getTo.

The end of the change interval.

public boolean
next()

Implements abstract javafx.collections.ListChangeListener.Change.next.

Goes to the next change.

public void
reset()

Implements abstract javafx.collections.ListChangeListener.Change.reset.

Resets to the initial stage.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

public boolean
wasPermutated()

Overrides javafx.collections.ListChangeListener.Change.wasPermutated.

Indicates if the change was only a permutation.

public boolean
wasUpdated()

Overrides javafx.collections.ListChangeListener.Change.wasUpdated.

Indicates that the elements between getFrom() (inclusive) to getTo() exclusive has changed.

Inherited from javafx.collections.ListChangeListener.Change:
getAddedSizegetAddedSubListgetListgetRemovedSizewasAddedwasRemovedwasReplaced

Field Detail

mapperback to summary
private final Function<E, F> mapper
originalback to summary
private final ListChangeListener.Change<? extends E> original
removedback to summary
private List<F> removed

Constructor Detail

MappingChangeback to summary
public MappingChange(ListChangeListener.Change<? extends E> original, Function<E, F> mapper, ObservableList<F> list)

Method Detail

getFromback to summary
public int getFrom()

Implements abstract javafx.collections.ListChangeListener.Change.getFrom.

Doc from javafx.collections.ListChangeListener.Change.getFrom.

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.

Returns:int

a beginning (inclusive) of an interval related to the change

Annotations
@Override
getPermutationback to summary
protected int[] getPermutation()

Implements abstract javafx.collections.ListChangeListener.Change.getPermutation.

Doc from javafx.collections.ListChangeListener.Change.getPermutation.

If this change is a 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 index getFrom() of the list. The same applies for the last index and getTo(). The method is used by wasPermutated() and getPermutation(int) methods.

Returns:int[]

empty array if this is not permutation or an integer array containing the permutation

Annotations
@Override
getPermutationback to summary
public int getPermutation(int i)

Overrides javafx.collections.ListChangeListener.Change.getPermutation.

Doc from javafx.collections.ListChangeListener.Change.getPermutation.

This method allows developers to observe the permutations that occurred in this change. In order to get the new position of an element, you must call:

   change.getPermutation(oldIndex);
Note: default implementation of this method takes the information from getPermutation() method. You don't have to override this method.
Parameters
i:int

the old index that contained the element prior to this change

Returns:int

the new index of the same element

Annotations
@Override
getRemovedback to summary
public List<F> getRemoved()

Implements abstract javafx.collections.ListChangeListener.Change.getRemoved.

Doc from javafx.collections.ListChangeListener.Change.getRemoved.

An immutable list of removed/replaced elements. If no elements were removed from the list, an empty list is returned.

Returns:List<F>

a list with all the removed elements

Annotations
@Override
getToback to summary
public int getTo()

Implements abstract javafx.collections.ListChangeListener.Change.getTo.

Doc from javafx.collections.ListChangeListener.Change.getTo.

The end of the change interval.

Returns:int

an end (exclusive) of an interval related to the change

Annotations
@Override
nextback to summary
public boolean next()

Implements abstract javafx.collections.ListChangeListener.Change.next.

Doc from javafx.collections.ListChangeListener.Change.next.

Goes to the next change. The Change instance, in its initial state, is invalid and requires a call to next() before calling other methods. The first next() call will make this object represent the first change.

Returns:boolean

true if switched to the next change, false if this is the last change

Annotations
@Override
resetback to summary
public void reset()

Implements abstract javafx.collections.ListChangeListener.Change.reset.

Doc from javafx.collections.ListChangeListener.Change.reset.

Resets to the initial stage. After this call, next() must be called before working with the first change.

Annotations
@Override
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@Override
wasPermutatedback to summary
public boolean wasPermutated()

Overrides javafx.collections.ListChangeListener.Change.wasPermutated.

Doc from javafx.collections.ListChangeListener.Change.wasPermutated.

Indicates if the change was only a permutation.

Returns:boolean

true if the change was just a permutation

Annotations
@Override
wasUpdatedback to summary
public boolean wasUpdated()

Overrides javafx.collections.ListChangeListener.Change.wasUpdated.

Doc from javafx.collections.ListChangeListener.Change.wasUpdated.

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.

Returns:boolean

true if the current change is an update change

Annotations
@Override