org.oddjob.beancmpr.comparers
Class IterableComparison<T>

java.lang.Object
  extended by org.oddjob.beancmpr.comparers.IterableComparison<T>
All Implemented Interfaces:
MultiItemComparisonCounts, Comparison<Iterable<? extends T>>

public class IterableComparison<T>
extends Object
implements Comparison<Iterable<? extends T>>, MultiItemComparisonCounts

A Comparison that is the result of comparing many things.

Author:
rob

Constructor Summary
IterableComparison(Iterable<? extends T> x, Iterable<? extends T> y, MultiItemComparisonCounts multiItemStats)
           
 
Method Summary
 int getBreaksCount()
           
 int getComparedCount()
           
 int getDifferentCount()
           
 int getMatchedCount()
           
 int getResult()
          The result of the comparison.
 String getSummaryText()
          Provide a brief summary of the comparison.
 Iterable<? extends T> getX()
          Get the x of the comparison.
 int getXMissingCount()
           
 Iterable<? extends T> getY()
          Get the y of the comparison.
 int getYMissingCount()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IterableComparison

public IterableComparison(Iterable<? extends T> x,
                          Iterable<? extends T> y,
                          MultiItemComparisonCounts multiItemStats)
Method Detail

getX

public Iterable<? extends T> getX()
Description copied from interface: Comparison
Get the x of the comparison.

Specified by:
getX in interface Comparison<Iterable<? extends T>>
Returns:
The x. Will not be null.

getY

public Iterable<? extends T> getY()
Description copied from interface: Comparison
Get the y of the comparison.

Specified by:
getY in interface Comparison<Iterable<? extends T>>
Returns:
The y. Will not be null.

getResult

public int getResult()
Description copied from interface: Comparison
The result of the comparison. 0 they are equal. -1 when x < y and 1 when x > y

Specified by:
getResult in interface Comparison<Iterable<? extends T>>
Returns:
true/false.

getSummaryText

public String getSummaryText()
Description copied from interface: Comparison
Provide a brief summary of the comparison.

If the comparison is equal then this should be the text representation of either of the original values. If the comparison is not equal then this should be a short description of the difference, e.g. 'Fred <> Jane'.

As a rule of thumb summary should be suitable for displaying in the column of a report or the cell of a spreadsheet.

Specified by:
getSummaryText in interface Comparison<Iterable<? extends T>>
Returns:
A short text description of the comparison.

getXMissingCount

public int getXMissingCount()
Specified by:
getXMissingCount in interface MultiItemComparisonCounts

getYMissingCount

public int getYMissingCount()
Specified by:
getYMissingCount in interface MultiItemComparisonCounts

getMatchedCount

public int getMatchedCount()
Specified by:
getMatchedCount in interface MultiItemComparisonCounts

getDifferentCount

public int getDifferentCount()
Specified by:
getDifferentCount in interface MultiItemComparisonCounts

getBreaksCount

public int getBreaksCount()
Specified by:
getBreaksCount in interface MultiItemComparisonCounts

getComparedCount

public int getComparedCount()
Specified by:
getComparedCount in interface MultiItemComparisonCounts


Copyright © 2013. All Rights Reserved.