de.lmu.ifi.dbs.elki.data
Class ClassLabel<L extends ClassLabel<L>>
java.lang.Object
de.lmu.ifi.dbs.elki.logging.AbstractLoggable
de.lmu.ifi.dbs.elki.data.ClassLabel<L>
- All Implemented Interfaces:
- Loggable, Comparable<L>
- Direct Known Subclasses:
- HierarchicalClassLabel, SimpleClassLabel
public abstract class ClassLabel<L extends ClassLabel<L>>
- extends AbstractLoggable
- implements Comparable<L>
A ClassLabel to identify a certain class of objects that is to discern from
other classes by a classifier.
- Author:
- Arthur Zimek
Constructor Summary |
protected |
ClassLabel()
ClassLabels need an empty constructor
for dynamic access. |
Method Summary |
boolean |
equals(Object obj)
Any ClassLabel should ensure a natural ordering that is consistent with
equals. |
int |
hashCode()
Returns the hashCode of the String-representation of this ClassLabel. |
abstract void |
init(String label)
Initialization of a ClassLabel for the given label. |
abstract String |
toString()
Any ClassLabel requires a method to represent the label as a String. |
Methods inherited from class de.lmu.ifi.dbs.elki.logging.AbstractLoggable |
debugFine, debugFiner, debugFinest, exception, message, progress, progress, progress, verbose, verbose, warning |
ClassLabel
protected ClassLabel()
- ClassLabels need an empty constructor
for dynamic access.
Subsequently, the init method must be called.
Sets as debug status
LoggingConfiguration.DEBUG
.
init
public abstract void init(String label)
- Initialization of a ClassLabel for the given label.
- Parameters:
label
- the label to create a ClassLabel
equals
public boolean equals(Object obj)
- Any ClassLabel should ensure a natural ordering that is consistent with
equals. Thus, if
this.compareTo(o)==0
, then
this.equals(o)
should be true
.
- Overrides:
equals
in class Object
- Parameters:
obj
- an object to test for equality w.r.t. this ClassLabel
- Returns:
- true, if
this==obj || this.compareTo(o)==0
, false
otherwise
toString
public abstract String toString()
- Any ClassLabel requires a method to represent the label as a String. If
ClassLabel a.equals((ClassLabel) b)
, then also
a.toString().equals(b.toString())
should hold.
- Overrides:
toString
in class Object
- See Also:
Object.toString()
hashCode
public int hashCode()
- Returns the hashCode of the String-representation of this ClassLabel.
- Overrides:
hashCode
in class Object
- See Also:
Object.hashCode()