Environment for
DeveLoping
KDD-Applications
Supported by Index-Structures

de.lmu.ifi.dbs.elki.data
Class SimpleClassLabel

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.logging.AbstractLoggable
      extended by de.lmu.ifi.dbs.elki.data.ClassLabel<SimpleClassLabel>
          extended by de.lmu.ifi.dbs.elki.data.SimpleClassLabel
All Implemented Interfaces:
Loggable, Comparable<SimpleClassLabel>

public class SimpleClassLabel
extends ClassLabel<SimpleClassLabel>

A simple class label casting a String as it is as label.

Author:
Arthur Zimek

Field Summary
private  String label
          Holds the String designating the label.
 
Fields inherited from class de.lmu.ifi.dbs.elki.logging.AbstractLoggable
debug
 
Constructor Summary
SimpleClassLabel()
           
 
Method Summary
 int compareTo(SimpleClassLabel 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.
 void init(String label)
          Provides a simple class label covering the given String.
 String toString()
          Returns a new instance of the String covered by this SimpleClassLabel.
 
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
 

Field Detail

label

private String label
Holds the String designating the label.

Constructor Detail

SimpleClassLabel

public SimpleClassLabel()
See Also:
ClassLabel.ClassLabel()
Method Detail

init

public void init(String label)
Provides a simple class label covering the given String.

Specified by:
init in class ClassLabel<SimpleClassLabel>
Parameters:
label - the String to be cast as label
See Also:
ClassLabel.init(String)

compareTo

public int compareTo(SimpleClassLabel o)
The ordering of two SimpleClassLabels is given by the ordering on the Strings they represent.

That is, the result equals this.label.compareTo(o.label).

See Also:
Comparable.compareTo(Object)

hashCode

public int hashCode()
The hash code of a simple class label is the hash code of the String represented by the ClassLabel.

Overrides:
hashCode in class ClassLabel<SimpleClassLabel>
See Also:
Object.hashCode()

equals

public boolean equals(Object o)
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 ClassLabel<SimpleClassLabel>
Parameters:
o - an object to test for equality w.r.t. this ClassLabel
Returns:
true, if this==obj || this.compareTo(o)==0, false otherwise

toString

public String toString()
Returns a new instance of the String covered by this SimpleClassLabel.

Specified by:
toString in class ClassLabel<SimpleClassLabel>
Returns:
a new instance of the String covered by this SimpleClassLabel
See Also:
ClassLabel.toString()

Release 0.1 (2008-07-10_1838)