JIDE 3.5.15

com.jidesoft.diff
Class Merge<T>

java.lang.Object
  extended by com.jidesoft.diff.Merge<T>

public class Merge<T>
extends Object

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

a

protected List<T> a
The source list, AKA the "from" values.


b

protected List<T> b
The target list, AKA the "to" values.


c

protected List<T> c
Another source list, AKA the "other" values.


conflicts

protected List<Conflict> conflicts
The list of conflicts, as Conflict instances.

Constructor Detail

Merge

public Merge(T[] from,
             T[] to,
             T[] otherFrom,
             Comparator<T> comparator)
Constructs the Merge object for the three arrays, using the given comparator.

Parameters:
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.

Merge

public 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.

Parameters:
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.

Merge

public 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.

Parameters:
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.

Merge

public 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.

Parameters:
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

merge

public List<Conflict> merge()
Runs the merge and return the list of conflicts/changes.

Returns:
the list of conflicts/changes.

JIDE 3.5.15