Package elki.data

Class SimpleClassLabel

  • All Implemented Interfaces:
    java.lang.Comparable<ClassLabel>

    public class SimpleClassLabel
    extends ClassLabel
    A simple class label casting a String as it is as label.
    Since:
    0.1
    Author:
    Arthur Zimek
    • Constructor Detail

      • SimpleClassLabel

        public SimpleClassLabel​(java.lang.String label)
        Constructor.
        Parameters:
        label - Label
    • Method Detail

      • compareTo

        public int compareTo​(ClassLabel o)
      • hashCode

        public int hashCode()
        Description copied from class: ClassLabel
        Returns the hashCode of the String-representation of this ClassLabel.
        Overrides:
        hashCode in class ClassLabel
      • equals

        public boolean equals​(java.lang.Object o)
        Description copied from class: ClassLabel
        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
        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 java.lang.String toString()
        Description copied from class: ClassLabel
        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.
        Specified by:
        toString in class ClassLabel