Package com.cupoftea.table
Class Categorical
java.lang.Object
com.cupoftea.table.Categorical
- All Implemented Interfaces:
Serializable,CharSequence,Comparable<Categorical>
public final class Categorical
extends Object
implements Serializable, Comparable<Categorical>, CharSequence
Logical type marker and value representation for dictionary-encoded / categorical string columns.
Can be used in Schema definitions (e.g., Schema.of("station", Schema.CATEGORICAL)
or Schema.of("station", Categorical.class)) and column type conversions
(df.alterColumnType("station", Categorical.class)) to store repeated string columns
using a compact dictionary lookup array and primitive integer codes.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncharcharAt(int index) intcompareTo(Categorical other) booleangetValue()inthashCode()intlength()static CategoricalsubSequence(int start, int end) toString()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.CharSequence
chars, codePoints, isEmpty
-
Constructor Details
-
Categorical
-
-
Method Details
-
of
-
getValue
-
length
public int length()- Specified by:
lengthin interfaceCharSequence
-
charAt
public char charAt(int index) - Specified by:
charAtin interfaceCharSequence
-
subSequence
- Specified by:
subSequencein interfaceCharSequence
-
compareTo
- Specified by:
compareToin interfaceComparable<Categorical>
-
equals
-
hashCode
public int hashCode() -
toString
- Specified by:
toStringin interfaceCharSequence- Overrides:
toStringin classObject
-