Package org.eclipse.gef.common.collections

## 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 java.lang.Object

An abstract elementary change of an `ObservableList`

### Nested Class Summary

Nested Classes
`static class` `ListListenerHelperEx.ElementarySubChange.Kind` The kind of change that is performed to the `ObservableList`.

### Constructor Summary

Constructors
`ElementarySubChange​(ListListenerHelperEx.ElementarySubChange.Kind kind, int from, int to, java.util.List<? extends E> removed, java.util.List<? extends E> added, int[] permutation)` Creates a new `ListListenerHelperEx.ElementarySubChange` .

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`static <E> ListListenerHelperEx.ElementarySubChange<E>` `added​(java.util.List<? extends E> added, int from, int to)` Creates a new `ListListenerHelperEx.ElementarySubChange` representing an addition.
`java.util.List<E>` `getAdded()` Returns the elements that were added by this change.
`int` `getFrom()` Returns the index at which elements were added/removed/re-ordered.
`ListListenerHelperEx.ElementarySubChange.Kind` `getKind()` Returns the kind of change.
`int[]` `getPermutation()` Returns a mapping of previous indexes to current ones
`java.util.List<E>` `getRemoved()` Returns 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 new `ListListenerHelperEx.ElementarySubChange` representing a permutation.
`static <E> ListListenerHelperEx.ElementarySubChange<E>` `removed​(java.util.List<? extends E> removed, int from, int to)` Creates a new `ListListenerHelperEx.ElementarySubChange` representing a removal.
`static <E> ListListenerHelperEx.ElementarySubChange<E>` `replaced​(java.util.List<? extends E> removed, java.util.List<? extends E> added, int from, int to)` Creates a new `ListListenerHelperEx.ElementarySubChange` representing a replacement.
`java.lang.String` `toString()`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Constructor Detail

#### ElementarySubChange

    public ElementarySubChange​(ListListenerHelperEx.ElementarySubChange.Kind kind,
                               int from,
                               int to,
                               java.util.List<? extends E> removed,
                               java.util.List<? extends E> added,
                               int[] permutation)

Creates a new `ListListenerHelperEx.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 Detail

#### added

    public static <E> ListListenerHelperEx.ElementarySubChange<E> added​(java.util.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​(java.util.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​(java.util.List<? extends E> removed,
                                                                           java.util.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 java.util.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

    public ListListenerHelperEx.ElementarySubChange.Kind 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 java.util.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 java.lang.String toString()

Overrides:
  `toString` in class `java.lang.Object`