public class ListDifferenceAnalyzer
extends java.lang.Object
ListChange
objects.Constructor and Description |
---|
ListDifferenceAnalyzer() |
Modifier and Type | Method and Description |
---|---|
EList<ListChange> |
analyzeLists(EList<?> oldList,
EList<?> newList)
Analyzes the differences between two lists, returning the
list changes
that describe how the newList could be changed to the contents of
oldList . |
void |
analyzeLists(EList<java.lang.Object> oldList,
EList<?> newList,
EList<ListChange> listChanges)
Analyzes the differences between two lists, adding new
list changes to the
specified listChanges . |
protected void |
createAddListChange(EList<java.lang.Object> oldList,
EList<ListChange> listChanges,
java.lang.Object newObject,
int index)
Convenience method added to allow subclasses to modify the default implementation
for the scenario in which an element was added to the monitored list.
|
protected ListChange |
createListChange(EList<ListChange> listChanges,
ChangeKind kind,
int index)
Creates a ListChange, initializes the main attributes, and adds it to the specified listChanges.
|
protected void |
createListChanges(EList<java.lang.Object> oldList,
EList<?> newList,
EList<ListChange> listChanges) |
protected void |
createMoveListChange(EList<?> oldList,
EList<ListChange> listChanges,
java.lang.Object newObject,
int index,
int toIndex)
Convenience method added to allow subclasses to modify the default implementation
for the scenario in which an element was moved in the monitored list.
|
protected void |
createRemoveListChange(EList<?> oldList,
EList<ListChange> listChanges,
java.lang.Object newObject,
int index)
Convenience method added to allow subclasses to modify the default implementation
for the scenario in which an element was removed from the monitored list.
|
protected boolean |
equal(java.lang.Object oldValue,
java.lang.Object newValue)
Used by
createListChanges(EList, EList, EList) to decide whether the old value is considered equal to the new value. |
public EList<ListChange> analyzeLists(EList<?> oldList, EList<?> newList)
list changes
that describe how the newList
could be changed to the contents of
oldList
. The lists are not modified by this method.oldList
- newList
- ListChange
public void analyzeLists(EList<java.lang.Object> oldList, EList<?> newList, EList<ListChange> listChanges)
Analyzes the differences between two lists, adding new list changes
to the
specified listChanges
. The list changes describe how the newList
should be manipulated in order to have the same contents of oldList
This methods changes the contents of oldList
oldList
- newList
- listChanges
- protected void createListChanges(EList<java.lang.Object> oldList, EList<?> newList, EList<ListChange> listChanges)
protected boolean equal(java.lang.Object oldValue, java.lang.Object newValue)
createListChanges(EList, EList, EList)
to decide whether the old value is considered equal to the new value.protected void createAddListChange(EList<java.lang.Object> oldList, EList<ListChange> listChanges, java.lang.Object newObject, int index)
protected void createRemoveListChange(EList<?> oldList, EList<ListChange> listChanges, java.lang.Object newObject, int index)
protected void createMoveListChange(EList<?> oldList, EList<ListChange> listChanges, java.lang.Object newObject, int index, int toIndex)
protected ListChange createListChange(EList<ListChange> listChanges, ChangeKind kind, int index)
listChanges
- kind
- index
-