uk.ac.ic.doc.automed.matching
Class Instance

java.lang.Object
  extended by uk.ac.ic.doc.automed.matching.Instance
All Implemented Interfaces:
java.util.Comparator

public class Instance
extends java.lang.Object
implements java.util.Comparator

The Instance class represents an instance and its number of appearances.


Constructor Summary
Instance()
           
Instance(java.lang.String value, int appearances)
          Constructs an Instance object.
 
Method Summary
 int compare(java.lang.Object o1, java.lang.Object o2)
           
 boolean equals(java.lang.Object o)
           
 int getAppearances()
          Returns the number of appearances of the value of this instance.
 java.lang.String getValue()
          Returns the value of this instance.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Instance

public Instance()

Instance

public Instance(java.lang.String value,
                int appearances)
Constructs an Instance object.

Parameters:
value - the value of the instance
appearances - the number of appearances of the specific value
Method Detail

compare

public int compare(java.lang.Object o1,
                   java.lang.Object o2)
Specified by:
compare in interface java.util.Comparator

equals

public boolean equals(java.lang.Object o)
Specified by:
equals in interface java.util.Comparator
Overrides:
equals in class java.lang.Object

getValue

public java.lang.String getValue()
Returns the value of this instance.

Returns:
the value of this instance

getAppearances

public int getAppearances()
Returns the number of appearances of the value of this instance.

Returns:
the number of appearances of the value of this instance

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object