public enum Primitive extends java.lang.Enum<Primitive> implements java.io.Serializable, Representable
| Enum Constant and Description |
|---|
BOOLEAN |
BYTES |
DOUBLE |
FLOAT |
INT |
LONG |
STRING |
| Modifier and Type | Method and Description |
|---|---|
abstract boolean |
canBeDenseDimension() |
abstract boolean |
canBeValue()
This method is called to check if the column Type of the value can be of the specified Primitive.
|
abstract int |
compare(ReadableTuple leftTuple,
int leftColumn,
ReadableTuple rightTuple,
int rightColumn)
Compares data at leftTuple[leftColumn] with data at rightTuple[rightColumn]
Note: The representation of both leftColumn and rightColumn is assumed to be the same as
this
No validation on representation is performed |
abstract void |
copy(ReadableTuple fromTuple,
int fromColumn,
WriteableTuple toTuple,
int toColumn)
Copies data from fromTuple[fromColumn] to toTuple[toColumn]
Note: The representation of both fromColumn and toColumn is assumed to be the same as
this
No validation on representation is performed |
abstract boolean |
equals(ReadableTuple leftTuple,
int leftColumn,
ReadableTuple rightTuple,
int rightColumn)
Matches data at leftTuple[leftColumn] with data at rightTuple[rightColumn]
Note: The representation of both leftColumn and rightColumn is assumed to be the same as
this
No validation on representation is performed |
abstract void |
from(boolean value,
WriteableTuple tuple,
int column) |
abstract void |
from(byte[] value,
WriteableTuple tuple,
int column)
Stores value from its byte[] serialization in the input tuple.
|
abstract void |
from(double value,
WriteableTuple tuple,
int column) |
abstract void |
from(float value,
WriteableTuple tuple,
int column) |
abstract void |
from(int value,
WriteableTuple tuple,
int column) |
abstract void |
from(long value,
WriteableTuple tuple,
int column) |
abstract void |
from(java.lang.Number value,
WriteableTuple tuple,
int column) |
void |
from(java.lang.Object value,
WriteableTuple tuple,
int column) |
abstract void |
from(java.lang.String value,
WriteableTuple tuple,
int column) |
Primitive |
getRepresentation() |
abstract boolean |
isInstance(java.lang.Object obj)
check whether the input object is of the primitive type without coercion.
|
abstract boolean |
toBoolean(ReadableTuple tuple,
int column) |
abstract byte[] |
toBytes(ReadableTuple tuple,
int column)
Returns value serialized into a byte[].
|
abstract double |
toDouble(ReadableTuple tuple,
int column) |
abstract float |
toFloat(ReadableTuple tuple,
int column) |
abstract int |
toInt(ReadableTuple tuple,
int column) |
abstract long |
toLong(ReadableTuple tuple,
int column) |
abstract java.lang.Object |
toObject(ReadableTuple tuple,
int column) |
abstract java.lang.String |
toString(ReadableTuple tuple,
int column) |
static Primitive |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static Primitive[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final Primitive INT
public static final Primitive LONG
public static final Primitive FLOAT
public static final Primitive DOUBLE
public static final Primitive BOOLEAN
public static final Primitive STRING
public static final Primitive BYTES
public static Primitive[] values()
for (Primitive c : Primitive.values()) System.out.println(c);
public static Primitive valueOf(java.lang.String name)
name - the name of the enum constant to be returned.java.lang.IllegalArgumentException - if this enum type has no constant with the specified namejava.lang.NullPointerException - if the argument is nullpublic Primitive getRepresentation()
getRepresentation in interface Representablepublic abstract int toInt(ReadableTuple tuple, int column)
public abstract long toLong(ReadableTuple tuple, int column)
public abstract float toFloat(ReadableTuple tuple, int column)
public abstract double toDouble(ReadableTuple tuple, int column)
public abstract boolean toBoolean(ReadableTuple tuple, int column)
public abstract java.lang.String toString(ReadableTuple tuple, int column)
public abstract byte[] toBytes(ReadableTuple tuple, int column)
tuple - Input tuplecolumn - Column indexpublic abstract java.lang.Object toObject(ReadableTuple tuple, int column)
public void from(java.lang.Object value,
WriteableTuple tuple,
int column)
public abstract void from(java.lang.Number value,
WriteableTuple tuple,
int column)
public abstract void from(int value,
WriteableTuple tuple,
int column)
public abstract void from(long value,
WriteableTuple tuple,
int column)
public abstract void from(float value,
WriteableTuple tuple,
int column)
public abstract void from(double value,
WriteableTuple tuple,
int column)
public abstract void from(boolean value,
WriteableTuple tuple,
int column)
public abstract void from(java.lang.String value,
WriteableTuple tuple,
int column)
public abstract void from(byte[] value,
WriteableTuple tuple,
int column)
value - Input valuetuple - Input tuple to store the valuecolumn - Column indexpublic abstract void copy(ReadableTuple fromTuple, int fromColumn, WriteableTuple toTuple, int toColumn)
this
No validation on representation is performedfromTuple - ReadableTuple from which to copyfromColumn - column in fromTuple to copytoTuple - WriteableTuple where the data would be copiedtoColumn - column in toTuple where the data would be copiedpublic abstract boolean equals(ReadableTuple leftTuple, int leftColumn, ReadableTuple rightTuple, int rightColumn)
this
No validation on representation is performedleftTuple - left tuple from which a column will be matchedleftColumn - column in leftTuple that will be matchedrightTuple - right tuple from which a column will be matchedrightColumn - column in right tuple that will be matchedpublic abstract int compare(ReadableTuple leftTuple, int leftColumn, ReadableTuple rightTuple, int rightColumn)
this
No validation on representation is performedleftTuple - left tuple from which a column will be comparedleftColumn - column in leftTuple that will be comparedrightTuple - right tuple from which a column will be comparedrightColumn - column in right tuple that will be comparedpublic abstract boolean canBeDenseDimension()
toInt(com.linkedin.feathr.common.tensor.ReadableTuple, int), toLong(com.linkedin.feathr.common.tensor.ReadableTuple, int), and from(java.lang.Object, com.linkedin.feathr.common.tensor.WriteableTuple, int) with both int and long value.public abstract boolean canBeValue()
public abstract boolean isInstance(java.lang.Object obj)