|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.unitils.reflectionassert.difference.Difference
org.unitils.reflectionassert.difference.UnorderedCollectionDifference
public class UnorderedCollectionDifference
A class for holding the difference between all elements of two collections or arrays.
| Constructor Summary | |
|---|---|
UnorderedCollectionDifference(String message,
Object leftValue,
Object rightValue,
List<?> leftList,
List<?> rightList)
Creates a difference. |
|
| Method Summary | ||
|---|---|---|
|
accept(DifferenceVisitor<T,A> visitor,
A argument)
Double dispatch method. |
|
void |
addElementDifference(int leftIndex,
int rightIndex,
Difference difference)
Adds a difference or a match for the elements at the given left and right index. |
|
Map<Integer,Integer> |
getBestMatchingIndexes()
Gets the indexes of the best matching element differences. |
|
int |
getBestMatchingScore()
Gets the matching score of the best matching indexes. |
|
Difference |
getElementDifference(int leftIndex,
int rightIndex)
Gets the difference between the elements with the given indexes. |
|
Map<Integer,Map<Integer,Difference>> |
getElementDifferences()
Gets all element differences per left index and right index. |
|
List<?> |
getLeftList()
|
|
List<?> |
getRightList()
|
|
void |
setBestMatchingIndexes(int leftIndex,
int rightIndex)
Sets the given left and right index as best matching elements. |
|
void |
setBestMatchingScore(int bestMatchingScore)
Gets the matching score of the best matching indexes. |
|
| Methods inherited from class org.unitils.reflectionassert.difference.Difference |
|---|
getLeftValue, getMessage, getRightValue |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public UnorderedCollectionDifference(String message,
Object leftValue,
Object rightValue,
List<?> leftList,
List<?> rightList)
message - a message describing the differenceleftValue - the left instancerightValue - the right instanceleftList - The left instance as a listrightList - The right instance as a list| Method Detail |
|---|
public void addElementDifference(int leftIndex,
int rightIndex,
Difference difference)
leftIndex - The index of the left elementrightIndex - The index of the right elementdifference - The difference, null for a match
public Difference getElementDifference(int leftIndex,
int rightIndex)
leftIndex - The left element indexrightIndex - The right element index
public Map<Integer,Map<Integer,Difference>> getElementDifferences()
public void setBestMatchingIndexes(int leftIndex,
int rightIndex)
leftIndex - The left indexrightIndex - The right indexpublic Map<Integer,Integer> getBestMatchingIndexes()
public int getBestMatchingScore()
public void setBestMatchingScore(int bestMatchingScore)
bestMatchingScore - The scorepublic List<?> getLeftList()
public List<?> getRightList()
public <T,A> T accept(DifferenceVisitor<T,A> visitor,
A argument)
accept in class Differencevisitor - The visitor, not nullargument - An optional argument for the visitor, null if not applicable
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||