public class SimpleClassLabel extends ClassLabel
Modifier and Type | Class and Description |
---|---|
static class |
SimpleClassLabel.Factory
Factory class
|
Modifier and Type | Field and Description |
---|---|
private String |
label
Holds the String designating the label.
|
Constructor and Description |
---|
SimpleClassLabel(String label)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(ClassLabel o)
The ordering of two SimpleClassLabels is given by the ordering on the
Strings they represent.
|
boolean |
equals(Object o)
Any ClassLabel should ensure a natural ordering that is consistent with
equals.
|
int |
hashCode()
The hash code of a simple class label is the hash code of the String
represented by the ClassLabel.
|
String |
toString()
Returns a new instance of the String covered by this SimpleClassLabel.
|
private String label
public SimpleClassLabel(String label)
label
- Labelpublic int compareTo(ClassLabel o)
this.label.compareTo(o.label)
.public int hashCode()
hashCode
in class ClassLabel
Object.hashCode()
public boolean equals(Object o)
this.compareTo(o)==0
, then
this.equals(o)
should be true
.equals
in class ClassLabel
o
- an object to test for equality w.r.t. this ClassLabelthis==obj || this.compareTo(o)==0
, false
otherwisepublic String toString()
toString
in class ClassLabel
Object.toString()