Package elki.data
Class SimpleClassLabel
- java.lang.Object
-
- elki.data.ClassLabel
-
- elki.data.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
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSimpleClassLabel.FactoryFactory class.static classSimpleClassLabel.SerializerSerialization class.
-
Field Summary
Fields Modifier and Type Field Description private java.lang.StringlabelHolds the String designating the label.static ByteBufferSerializer<SimpleClassLabel>SERIALIZERSerializer.static SimpleTypeInformation<SimpleClassLabel>TYPEType information.
-
Constructor Summary
Constructors Constructor Description SimpleClassLabel(java.lang.String label)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(ClassLabel o)booleanequals(java.lang.Object o)Any ClassLabel should ensure a natural ordering that is consistent with equals.inthashCode()Returns the hashCode of the String-representation of this ClassLabel.java.lang.StringtoString()Any ClassLabel requires a method to represent the label as a String.
-
-
-
Field Detail
-
SERIALIZER
public static final ByteBufferSerializer<SimpleClassLabel> SERIALIZER
Serializer.
-
TYPE
public static final SimpleTypeInformation<SimpleClassLabel> TYPE
Type information.
-
label
private java.lang.String label
Holds the String designating the label.
-
-
Method Detail
-
compareTo
public int compareTo(ClassLabel o)
-
hashCode
public int hashCode()
Description copied from class:ClassLabelReturns the hashCode of the String-representation of this ClassLabel.- Overrides:
hashCodein classClassLabel
-
equals
public boolean equals(java.lang.Object o)
Description copied from class:ClassLabelAny ClassLabel should ensure a natural ordering that is consistent with equals. Thus, ifthis.compareTo(o)==0, thenthis.equals(o)should betrue.- Overrides:
equalsin classClassLabel- 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:ClassLabelAny ClassLabel requires a method to represent the label as a String. IfClassLabel a.equals((ClassLabel) b), then alsoa.toString().equals(b.toString())should hold.- Specified by:
toStringin classClassLabel
-
-