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.


Field Summary
 
Fields inherited from interface edu.indiana.util.swing.SwingRepresentable
TITLE_FONT
 
Method Summary
 int compareTo(java.lang.Object p1)
          Compare "this" with the parameter (a CaseDifferencePair).
 Case getCase()
           
 double getDifference()
           
 void setDifference(double diff)
           
 java.lang.String toString()
          Get a string representation of this CaseDifferencePair
 java.lang.String toString(Domain domain)
           
 
Methods inherited from interface edu.indiana.iucbrf.util.SwingRepresentableWithDomain
toSwing
 
Methods inherited from interface edu.indiana.util.swing.SwingRepresentable
toSwing
 

Method Detail

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)