edu.indiana.iucbrf.casepackage
Interface CaseDifferencePair
- All Superinterfaces:
- java.lang.Comparable, SwingRepresentable, SwingRepresentableWithDomain
- All Known Implementing Classes:
- CaseDifferencePairImpl
public interface CaseDifferencePair
- extends java.lang.Comparable, SwingRepresentableWithDomain
A holder for a case and its difference from a problem.
getCase
Case getCase()
getDifference
double getDifference()
setDifference
void setDifference(double diff)
compareTo
int compareTo(java.lang.Object p1)
- Compare "this" with the parameter (a CaseDifferencePair).
TreeSet.add will add elements in ascending order, according to this compareTo() implementation.
If this.diff is greater than p1.diff, then 1 is returned.
If this.diff is less than p1.diff, then -1 is returned.
If this.diff is equal to p1.diff, then the difference in their hashcodes is returned.
This is so both CaseDifferencePair can still be added to the TreeSet.
- Specified by:
compareTo
in interface java.lang.Comparable
toString
java.lang.String toString()
- Get a string representation of this CaseDifferencePair
- Overrides:
toString
in class java.lang.Object
toString
java.lang.String toString(Domain domain)