de.gruschke.dasync
Class MapComparer
java.lang.Object
|
+--de.gruschke.dasync.MapComparer
- Direct Known Subclasses:
- PrintDiffMapComparer, UpdateDSMapComparer
- public abstract class MapComparer
- extends java.lang.Object
Functionality common to all sorts of synchronization jobs.
- Author:
- Boris Gruschke
Field Summary |
protected boolean |
verbose
|
Method Summary |
void |
compare(java.util.Map one,
java.util.Map two)
Computes comparison of two maps
Compare invokes the methods inOneOnly(...) ,
inTwoOnly(...) if a key appears in one of the
maps only, oneAndTwoDiffer(...) if
a key appears in both maps but with different values and
oneAndTwoEqual(...) if a key appears in both
maps and both values are equal. |
protected abstract void |
inOneOnly(java.lang.Object key,
java.lang.Object value)
Key appears in Map one only |
protected abstract void |
inTwoOnly(java.lang.Object key,
java.lang.Object value)
Key appears in Map two only |
protected abstract void |
oneAndTwoDiffer(java.lang.Object key,
java.lang.Object valueOne,
java.lang.Object valueTwo)
Key appears in both Maps but with different values |
protected abstract void |
oneAndTwoEqual(java.lang.Object key,
java.lang.Object value)
Key appears in both Maps with equal values |
void |
setVerbose()
screw up the debugging |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
verbose
protected boolean verbose
MapComparer
public MapComparer()
compare
public void compare(java.util.Map one,
java.util.Map two)
- Computes comparison of two maps
Compare invokes the methods
inOneOnly(...)
,
inTwoOnly(...)
if a key appears in one of the
maps only, oneAndTwoDiffer(...)
if
a key appears in both maps but with different values and
oneAndTwoEqual(...)
if a key appears in both
maps and both values are equal.
- Parameters:
one
- Map of Keys and DataRow
objectstwo
- Map of Keys and DataRow
objects
setVerbose
public void setVerbose()
- screw up the debugging
inOneOnly
protected abstract void inOneOnly(java.lang.Object key,
java.lang.Object value)
- Key appears in Map one only
- Parameters:
key
- key object from Map onevalue
- DataRow
object from Map one
inTwoOnly
protected abstract void inTwoOnly(java.lang.Object key,
java.lang.Object value)
- Key appears in Map two only
- Parameters:
key
- key object from Map twovalue
- DataRow
object from Map two
oneAndTwoDiffer
protected abstract void oneAndTwoDiffer(java.lang.Object key,
java.lang.Object valueOne,
java.lang.Object valueTwo)
- Key appears in both Maps but with different values
- Parameters:
key
- key object from one of the MapsvalueOne
- DataRow
object from Map onevalueTwo
- DataRow
object from Map two
oneAndTwoEqual
protected abstract void oneAndTwoEqual(java.lang.Object key,
java.lang.Object value)
- Key appears in both Maps with equal values
- Parameters:
key
- key object from one of the Mapsvalue
- DataRow
object from one of the Maps
Boris Gruschke, 2000-11-11
License: GPL