Environment for
DeveLoping
KDD-Applications
Supported by Index-Structures

de.lmu.ifi.dbs.elki.data
Class ClassLabel<L extends ClassLabel<L>>

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.logging.AbstractLoggable
      extended by 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

Field Summary
 
Fields inherited from class de.lmu.ifi.dbs.elki.logging.AbstractLoggable
debug
 
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
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Constructor Detail

ClassLabel

protected ClassLabel()
ClassLabels need an empty constructor for dynamic access. Subsequently, the init method must be called. Sets as debug status LoggingConfiguration.DEBUG.

Method Detail

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()

Release 0.1 (2008-07-10_1838)