public class Feature extends java.lang.Object implements java.lang.Comparable<Feature>, galileo.serialization.ByteSerializable
Modifier and Type | Field and Description |
---|---|
protected galileo.dataset.feature.FeatureData<? extends java.lang.Comparable<?>> |
data |
protected java.lang.String |
name |
Constructor and Description |
---|
Feature()
Constructs a nameless, null Feature (no data).
|
Feature(byte[] bytes)
Constructs a nameless Feature that contains raw binary information
(byte array).
|
Feature(double value)
Constructs a nameless double-precision floating point Feature.
|
Feature(double value1,
double value2)
Constructs a nameless interval Feature with bounds specified as
double-precision floating point values.
|
Feature(Feature feature)
Creates a shallow copy of a Feature.
|
Feature(float value)
Constructs a nameless floating point Feature.
|
Feature(float value1,
float value2)
Constructs a nameless interval Feature with bounds specified as floating
point values.
|
Feature(int value)
Constructs a nameless integer Feature.
|
Feature(int value1,
int value2)
Constructs a nameless interval Feature with bounds specified as int
values.
|
Feature(long value)
Constructs a nameless long Feature.
|
Feature(long value1,
long value2)
Constructs an interval Feature with bounds specified as long values.
|
Feature(galileo.serialization.SerializationInputStream in) |
Feature(java.lang.String name)
Constructs a null Feature (no data).
|
Feature(java.lang.String name,
byte[] bytes)
Constructs a Feature that contains raw binary information (byte array).
|
Feature(java.lang.String name,
double value)
Constructs a double-precision floating point Feature.
|
Feature(java.lang.String name,
double value1,
double value2)
Constructs an interval Feature with bounds specified as double-precision
floating point values.
|
Feature(java.lang.String name,
Feature feature)
Creates a shallow copy of a Feature with the provided name.
|
Feature(java.lang.String name,
FeatureType type,
galileo.serialization.SerializationInputStream in) |
Feature(java.lang.String name,
float value)
Constructs a floating point Feature.
|
Feature(java.lang.String name,
float value1,
float value2)
Constructs an interval Feature with bounds specified as floating point
values.
|
Feature(java.lang.String name,
int value)
Constructs an integer Feature.
|
Feature(java.lang.String name,
int value1,
int value2)
Constructs an interval Feature with bounds specified as int values.
|
Feature(java.lang.String name,
long value)
Constructs a long Feature.
|
Feature(java.lang.String name,
long value1,
long value2)
Constructs an interval Feature with bounds specified as long values.
|
Feature(java.lang.String name,
java.lang.String value)
Constructs a String Feature.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(Feature otherFeature) |
java.lang.String |
dataToString() |
boolean |
equals(java.lang.Object obj) |
static Feature |
fromNativeType(java.lang.Object o)
Converts a native Object to a nameless Feature.
|
static Feature |
fromNativeType(java.lang.String name,
java.lang.Object o)
Converts a native Object to a Feature if the Object type is not known in
advance.
|
galileo.dataset.feature.FeatureData<?> |
getDataContainer()
Retrieves the raw data container that holds this Feature data.
|
double |
getDouble() |
float |
getFloat() |
int |
getInt() |
galileo.dataset.feature.IntervalFeatureData<?> |
getInterval()
If this Feature contains an interval, this method retrieves the general
IntervalFeatureData container. |
long |
getLong() |
java.lang.String |
getName() |
byte[] |
getRawBytes()
If this Feature contains raw bytes, this method retrieves them as a
native Java byte array.
|
java.lang.String |
getString()
Returns the current Feature data as a String value.
|
FeatureType |
getType() |
boolean |
greater(Feature f) |
int |
hashCode() |
boolean |
isInterval() |
boolean |
isRawBytes() |
boolean |
less(Feature f) |
void |
serialize(galileo.serialization.SerializationOutputStream out) |
java.lang.String |
toString() |
protected java.lang.String name
protected galileo.dataset.feature.FeatureData<? extends java.lang.Comparable<?>> data
public Feature()
public Feature(java.lang.String name)
public Feature(java.lang.String name, int value)
public Feature(int value)
public Feature(java.lang.String name, long value)
public Feature(long value)
public Feature(java.lang.String name, float value)
public Feature(float value)
public Feature(java.lang.String name, double value)
public Feature(double value)
public Feature(java.lang.String name, int value1, int value2)
public Feature(int value1, int value2)
public Feature(java.lang.String name, long value1, long value2)
public Feature(long value1, long value2)
public Feature(java.lang.String name, float value1, float value2)
public Feature(float value1, float value2)
public Feature(java.lang.String name, double value1, double value2)
public Feature(double value1, double value2)
public Feature(java.lang.String name, java.lang.String value)
public Feature(byte[] bytes)
public Feature(java.lang.String name, byte[] bytes)
public Feature(Feature feature)
public Feature(java.lang.String name, Feature feature)
@ByteSerializable.Deserialize public Feature(java.lang.String name, FeatureType type, galileo.serialization.SerializationInputStream in) throws java.io.IOException, galileo.serialization.SerializationException
java.io.IOException
galileo.serialization.SerializationException
@ByteSerializable.Deserialize public Feature(galileo.serialization.SerializationInputStream in) throws java.io.IOException, galileo.serialization.SerializationException
java.io.IOException
galileo.serialization.SerializationException
public static Feature fromNativeType(java.lang.Object o)
o
- Object to convert to a Featurepublic static Feature fromNativeType(java.lang.String name, java.lang.Object o)
name
- Name of the resulting Featureo
- Object to convert to a Featurepublic java.lang.String getName()
public FeatureType getType()
public boolean isInterval()
public boolean isRawBytes()
public int getInt()
public long getLong()
public float getFloat()
public double getDouble()
public galileo.dataset.feature.IntervalFeatureData<?> getInterval()
IntervalFeatureData
container.java.lang.ClassCastException
- if the underlying FeatureData is not an
interval.public byte[] getRawBytes()
java.lang.ClassCastException
- if the underlying FeatureData is not
BinaryFeatureDatapublic galileo.dataset.feature.FeatureData<?> getDataContainer()
FeatureData
can be used directly or casted to a subclass to
obtain specific functionality.public java.lang.String getString()
public boolean greater(Feature f)
public boolean less(Feature f)
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int compareTo(Feature otherFeature)
compareTo
in interface java.lang.Comparable<Feature>
public java.lang.String dataToString()
public java.lang.String toString()
toString
in class java.lang.Object
public void serialize(galileo.serialization.SerializationOutputStream out) throws java.io.IOException
serialize
in interface galileo.serialization.ByteSerializable
java.io.IOException