private static class ListChangeBuilder.SingleChange<E> extends ListChangeListener.Change<E>
Modifier and Type | Field and Description |
---|---|
private ListChangeBuilder.SubChange<E> |
change |
private boolean |
onChange |
Constructor and Description |
---|
SingleChange(ListChangeBuilder.SubChange<E> change,
ObservableListBase<E> list) |
Modifier and Type | Method and Description |
---|---|
private void |
checkState() |
int |
getFrom()
If
ListChangeListener.Change.wasAdded() is true, the interval contains all the values that were added. |
protected int[] |
getPermutation()
If this change is a permutation, it returns an integer array
that describes the permutation.
|
java.util.List<E> |
getRemoved()
An immutable list of removed/replaced elements.
|
int |
getTo()
The end of the change interval.
|
boolean |
next()
Goes to the next change.
|
void |
reset()
Resets to the initial stage.
|
java.lang.String |
toString() |
boolean |
wasUpdated()
Indicates that the elements between
ListChangeListener.Change.getFrom() (inclusive)
to ListChangeListener.Change.getTo() exclusive has changed. |
getAddedSize, getAddedSubList, getList, getPermutation, getRemovedSize, wasAdded, wasPermutated, wasRemoved, wasReplaced
private final ListChangeBuilder.SubChange<E> change
private boolean onChange
public SingleChange(ListChangeBuilder.SubChange<E> change, ObservableListBase<E> list)
public boolean next()
ListChangeListener.Change
next()
before
calling other methods. The first next()
call will make this object
represent the first change.next
in class ListChangeListener.Change<E>
public void reset()
ListChangeListener.Change
ListChangeListener.Change.next()
must be called
before working with the first change.reset
in class ListChangeListener.Change<E>
public int getFrom()
ListChangeListener.Change
ListChangeListener.Change.wasAdded()
is true, the interval contains all the values that were added.
If ListChangeListener.Change.wasPermutated()
is true, the interval marks the values that were permutated.
If ListChangeListener.Change.wasRemoved()
is true and wasAdded
is false, ListChangeListener.Change.getFrom()
and ListChangeListener.Change.getTo()
should return the same number - the place where the removed elements were positioned in the list.getFrom
in class ListChangeListener.Change<E>
public int getTo()
ListChangeListener.Change
getTo
in class ListChangeListener.Change<E>
ListChangeListener.Change.getFrom()
public java.util.List<E> getRemoved()
ListChangeListener.Change
getRemoved
in class ListChangeListener.Change<E>
protected int[] getPermutation()
ListChangeListener.Change
ListChangeListener.Change.getFrom()
of the list. The same applies
for the last index and ListChangeListener.Change.getTo()
.
The method is used by ListChangeListener.Change.wasPermutated()
and ListChangeListener.Change.getPermutation(int)
methods.getPermutation
in class ListChangeListener.Change<E>
public boolean wasUpdated()
ListChangeListener.Change
ListChangeListener.Change.getFrom()
(inclusive)
to ListChangeListener.Change.getTo()
exclusive has changed.
This is the only optional event type and may not be
fired by all ObservableLists.wasUpdated
in class ListChangeListener.Change<E>
private void checkState()
public java.lang.String toString()
toString
in class java.lang.Object