|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.jidesoft.diff.Merge<T>
public class Merge<T>
Compares three lists, returning a list of the conflicts and changes among them. A Comparator
may be
passed as an argument to the constructor, and will thus be used. If not provided, the initial value in the
a
("from") list will be looked at to see if it supports the Comparable
interface. If so,
its equals
and compareTo
methods will be invoked on the instances in the "from" and "to"
lists; otherwise, for speed, hash codes from the objects will be used instead for comparison.
Field Summary | |
---|---|
protected List<T> |
a
The source list, AKA the "from" values. |
protected List<T> |
b
The target list, AKA the "to" values. |
protected List<T> |
c
Another source list, AKA the "other" values. |
protected List<Conflict> |
conflicts
The list of conflicts, as Conflict instances. |
Constructor Summary | |
---|---|
Merge(List<T> from,
List<T> to,
List<T> otherFrom)
Constructs the Merge object for the three arrays, using the default comparison mechanism between the objects, such as equals and compareTo . |
|
Merge(List<T> from,
List<T> to,
List<T> otherFrom,
Comparator<T> comparator)
Constructs the Merge object for the three arrays, using the given comparator. |
|
Merge(T[] from,
T[] to,
T[] otherFrom)
Constructs the Merge object for the three arrays, using the default comparison mechanism between the objects, such as equals and compareTo . |
|
Merge(T[] from,
T[] to,
T[] otherFrom,
Comparator<T> comparator)
Constructs the Merge object for the three arrays, using the given comparator. |
Method Summary | |
---|---|
List<Conflict> |
merge()
Runs the merge and return the list of conflicts/changes. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected List<T> a
protected List<T> b
protected List<T> c
protected List<Conflict> conflicts
Conflict
instances.
Constructor Detail |
---|
public Merge(T[] from, T[] to, T[] otherFrom, Comparator<T> comparator)
from
- the "from" value. It is the first source list.to
- the "to" value. It is the target list.otherFrom
- the "other" value. It is the second source list.comparator
- the comparator.public Merge(T[] from, T[] to, T[] otherFrom)
equals
and compareTo
.
from
- the "from" value. It is the first source list.to
- the "to" value. It is the target list.otherFrom
- the "other" value. It is the second source list.public Merge(List<T> from, List<T> to, List<T> otherFrom, Comparator<T> comparator)
from
- the "from" value. It is the first source list.to
- the "to" value. It is the target list.otherFrom
- the "other" value. It is the second source list.comparator
- the comparator.public Merge(List<T> from, List<T> to, List<T> otherFrom)
equals
and compareTo
.
from
- the "from" value. It is the first source list.to
- the "to" value. It is the target list.otherFrom
- the "other" value. It is the second source list.Method Detail |
---|
public List<Conflict> merge()
|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |