public class ListDelta<T,U> extends Delta
| Modifier and Type | Method and Description |
|---|---|
void |
addChange(int atIndex,
Delta change) |
static <T,U> Delta |
compare(Delta parent,
java.util.List<T> tt,
java.util.List<U> uu)
Compare two
List instances. |
Delta |
getChange(int index)
Get a change for a given index.
|
java.util.Map<java.lang.Integer,Delta> |
getChanges()
Get all changes as a map where key is an index of changed item and a value is a
Delta instance
describing the change. |
boolean |
isEmpty() |
between, getNestedDelta, getParent, newValue, oldValue, registerInParentpublic java.util.Map<java.lang.Integer,Delta> getChanges()
Delta instance
describing the change.public static <T,U> Delta compare(Delta parent, java.util.List<T> tt, java.util.List<U> uu)
List instances. Note that current implementation assumes position-dependent array, not set,
does not look for minimal delta, e.g. if the first element is popped (all attay shifted) it will provide attay of
ChangedItem instances and RemovedItem for the last element, what is not exactly right for arrays
used as sets. We strongly recommend using hash-based sets.T - U - parent - tt - uu - ListDelta instance or null if lists appears to be equalpublic void addChange(int atIndex,
Delta change)
public boolean isEmpty()
public Delta getChange(int index)
index - integer index value