Package elki.data

Class ClassLabel

  • All Implemented Interfaces:
    java.lang.Comparable<ClassLabel>
    Direct Known Subclasses:
    HierarchicalClassLabel, SimpleClassLabel

    public abstract class ClassLabel
    extends java.lang.Object
    implements java.lang.Comparable<ClassLabel>
    A ClassLabel to identify a certain class of objects that is to discern from other classes by a classifier.
    Since:
    0.1
    Author:
    Arthur Zimek
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  ClassLabel.Factory<L extends ClassLabel>
      Class label factory.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected ClassLabel()
      ClassLabels need an empty constructor for dynamic access.
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.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 java.lang.String toString()
      Any ClassLabel requires a method to represent the label as a String.
      • 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.
    • Method Detail

      • equals

        public boolean equals​(java.lang.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 java.lang.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 java.lang.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 java.lang.Object
      • hashCode

        public int hashCode()
        Returns the hashCode of the String-representation of this ClassLabel.
        Overrides:
        hashCode in class java.lang.Object