Class ListListenerHelperEx.ElementarySubChange<E>
java.lang.Object
org.eclipse.gef.common.collections.ListListenerHelperEx.ElementarySubChange<E>
- Type Parameters:
E
- The element type of the list.
- Enclosing class:
- ListListenerHelperEx<E>
An abstract elementary change of an
ObservableList
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
The kind of change that is performed to theObservableList
. -
Constructor Summary
ConstructorsConstructorDescriptionElementarySubChange
(ListListenerHelperEx.ElementarySubChange.Kind kind, int from, int to, List<? extends E> removed, List<? extends E> added, int[] permutation) Creates a newListListenerHelperEx.ElementarySubChange
. -
Method Summary
Modifier and TypeMethodDescriptionstatic <E> ListListenerHelperEx.ElementarySubChange<E>
Creates a newListListenerHelperEx.ElementarySubChange
representing an addition.getAdded()
Returns the elements that were added by this change.int
getFrom()
Returns the index at which elements were added/removed/re-ordered.getKind()
Returns the kind of change.int[]
Returns a mapping of previous indexes to current onesReturns the elements that were removed by this change.int
getTo()
Returns the index up to which (excluding) elements were added/removed/re-ordered.static <E> ListListenerHelperEx.ElementarySubChange<E>
permutated
(int[] permutation, int from, int to) Creates a newListListenerHelperEx.ElementarySubChange
representing a permutation.static <E> ListListenerHelperEx.ElementarySubChange<E>
Creates a newListListenerHelperEx.ElementarySubChange
representing a removal.static <E> ListListenerHelperEx.ElementarySubChange<E>
Creates a newListListenerHelperEx.ElementarySubChange
representing a replacement.toString()
-
Constructor Details
-
ElementarySubChange
public ElementarySubChange(ListListenerHelperEx.ElementarySubChange.Kind kind, int from, int to, List<? extends E> removed, List<? extends E> added, int[] permutation) Creates a newListListenerHelperEx.ElementarySubChange
.- Parameters:
kind
- The kind of change.from
- The start index of the change.to
- The end index of the change.removed
- The elements that were removed.added
- The elements that were added.permutation
- A mapping of prior indexes to current ones.
-
-
Method Details
-
added
public static <E> ListListenerHelperEx.ElementarySubChange<E> added(List<? extends E> added, int from, int to) Creates a newListListenerHelperEx.ElementarySubChange
representing an addition.- Type Parameters:
E
- The element type of theObservableList
.- Parameters:
from
- The start index of the change.to
- The end index of the change.added
- The elements that were added during this change.- Returns:
- An
ListListenerHelperEx.ElementarySubChange
representing the change.
-
permutated
public static <E> ListListenerHelperEx.ElementarySubChange<E> permutated(int[] permutation, int from, int to) Creates a newListListenerHelperEx.ElementarySubChange
representing a permutation.- Type Parameters:
E
- The element type of theObservableList
.- Parameters:
permutation
- A mapping of prior indexes to current ones.from
- The start index of the change.to
- The end index of the change.- Returns:
- An
ListListenerHelperEx.ElementarySubChange
representing the change.
-
removed
public static <E> ListListenerHelperEx.ElementarySubChange<E> removed(List<? extends E> removed, int from, int to) Creates a newListListenerHelperEx.ElementarySubChange
representing a removal.- Type Parameters:
E
- The element type of theObservableList
.- Parameters:
from
- The start index of the change.to
- The end index of the change.removed
- The elements that were removed during this change.- Returns:
- An
ListListenerHelperEx.ElementarySubChange
representing the change.
-
replaced
public static <E> ListListenerHelperEx.ElementarySubChange<E> replaced(List<? extends E> removed, List<? extends E> added, int from, int to) Creates a newListListenerHelperEx.ElementarySubChange
representing a replacement.- Type Parameters:
E
- The element type of theObservableList
.- Parameters:
removed
- The elements that were removed.from
- The start index of the change.to
- The end index of the change.added
- The elements that were added during this change.- Returns:
- An
ListListenerHelperEx.ElementarySubChange
representing the change.
-
getAdded
Returns the elements that were added by this change.- Returns:
- The added elements.
-
getFrom
public int getFrom()Returns the index at which elements were added/removed/re-ordered.- Returns:
- The start index.
-
getKind
Returns the kind of change.- Returns:
- The change kind.
-
getPermutation
public int[] getPermutation()Returns a mapping of previous indexes to current ones- Returns:
- An integer array representing a mapping of previous indexes to current indexes.
-
getRemoved
Returns the elements that were removed by this change.- Returns:
- The removed elements.
-
getTo
public int getTo()Returns the index up to which (excluding) elements were added/removed/re-ordered.- Returns:
- The end index.
-
toString
-