shared
Class AttrLabelPair
java.lang.Object
|
+--shared.AttrLabelPair
- public class AttrLabelPair
- extends java.lang.Object
- implements Sortable, java.lang.Comparable
This class contains basic information on labels and attributes.
|
Field Summary |
int |
label
Value for nominal information. |
float |
value
Value for real information. |
double |
weight
Weight value for this attribute. |
|
Method Summary |
int |
compareTo(java.lang.Object compare)
Compares this AttrLabelPair to the specified object. |
boolean |
Equals(Sortable otherSortable)
Compares this AttrLabelPair to another AttrLabelPair. |
boolean |
lessThan(Sortable otherSortable)
Compares this AttrLabelPair to another AttrLabelPair. |
java.lang.String |
toString()
Converts this AttrLabelPair to a String. |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
value
public float value
- Value for real information.
label
public int label
- Value for nominal information.
weight
public double weight
- Weight value for this attribute.
AttrLabelPair
public AttrLabelPair()
- Constructor.
lessThan
public boolean lessThan(Sortable otherSortable)
- Compares this AttrLabelPair to another AttrLabelPair.
- Specified by:
- lessThan in interface Sortable
- Parameters:
otherSortable - The instance implementing the Sortable interface to which this AttrLabelPair is
being compared to.- Returns:
- TRUE if this AttrLabelPair has a smaller value, smaller label and
equal value, or smaller weight and equal value and label.
Equals
public boolean Equals(Sortable otherSortable)
- Compares this AttrLabelPair to another AttrLabelPair.
- Specified by:
- Equals in interface Sortable
- Parameters:
otherSortable - The specified AttrLabelPair. This object should be
an AttrLabelPair or a subclass of this class.- Returns:
- TRUE if both AttrLabelPairs contain equivalent information.
toString
public java.lang.String toString()
- Converts this AttrLabelPair to a String.
- Overrides:
- toString in class java.lang.Object
- Returns:
- A String with information on the value, label, and weight values.
compareTo
public int compareTo(java.lang.Object compare)
throws java.lang.ClassCastException
- Compares this AttrLabelPair to the specified object.
- Specified by:
- compareTo in interface java.lang.Comparable
- Parameters:
compare - The object to be tested.- Returns:
- -1 if this AttrLabelPair is less than the specified object,
0 if equal, or 1 otherwise.
- Throws:
- java.lang.ClassCastException - if the specified object's type prevents it from
being compared to this object.