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>

public static class ListListenerHelperEx.ElementarySubChange<E> extends Object
An abstract elementary change of an ObservableList
  • Constructor Details

    • ElementarySubChange

      public ElementarySubChange(ListListenerHelperEx.ElementarySubChange.Kind kind, int from, int to, List<? extends E> removed, List<? extends E> added, int[] permutation)
      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 new ListListenerHelperEx.ElementarySubChange representing an addition.
      Type Parameters:
      E - The element type of the ObservableList.
      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 new ListListenerHelperEx.ElementarySubChange representing a permutation.
      Type Parameters:
      E - The element type of the ObservableList.
      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 new ListListenerHelperEx.ElementarySubChange representing a removal.
      Type Parameters:
      E - The element type of the ObservableList.
      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 new ListListenerHelperEx.ElementarySubChange representing a replacement.
      Type Parameters:
      E - The element type of the ObservableList.
      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

      public List<E> 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

      public List<E> 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

      public String toString()
      Overrides:
      toString in class Object