Package elki.data
Class ClassLabel
- java.lang.Object
-
- elki.data.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.
-
-
-
Method Detail
-
equals
public boolean equals(java.lang.Object obj)
Any ClassLabel should ensure a natural ordering that is consistent with equals. Thus, ifthis.compareTo(o)==0
, thenthis.equals(o)
should betrue
.- Overrides:
equals
in classjava.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. IfClassLabel a.equals((ClassLabel) b)
, then alsoa.toString().equals(b.toString())
should hold.- Overrides:
toString
in classjava.lang.Object
-
hashCode
public int hashCode()
Returns the hashCode of the String-representation of this ClassLabel.- Overrides:
hashCode
in classjava.lang.Object
-
-