public class FeatureArray
extends java.lang.Object
implements galileo.serialization.ByteSerializable
Feature
instances.Constructor and Description |
---|
FeatureArray(FeatureType type,
int... dimensions)
Creates a new FeatureArray with the specified dimensions and a specific
FeatureType . |
FeatureArray(int... dimensions)
Creates a new FeatureArray with the specified dimensions.
|
FeatureArray(galileo.serialization.SerializationInputStream in) |
FeatureArray(java.lang.String name,
FeatureType type,
int... dimensions)
Creates a new FeatureArray with the specified dimensions and a specific
FeatureType and Feature name. |
FeatureArray(java.lang.String name,
java.lang.Object features)
Creates a FeatureArray from a Java array.
|
Modifier and Type | Method and Description |
---|---|
void |
erase(int... indices)
Clears the Feature at the provided indices.
|
Feature |
get(int... indices)
Retrieves the Feature at the provided indices.
|
int[] |
getDimensions()
Gets the size of the dimensions in this array.
|
java.lang.String |
getName() |
int |
getRank()
Retrieves the rank (dimensionality) of this array.
|
int |
getSize()
Retrieves the overall size of the (flattened) array.
|
FeatureType |
getType() |
boolean |
isNamed() |
boolean |
isTyped() |
void |
serialize(galileo.serialization.SerializationOutputStream out) |
void |
set(Feature feature,
int... indices)
Sets the value of the Feature at the provided indices.
|
public FeatureArray(java.lang.String name, FeatureType type, int... dimensions)
FeatureType
and Feature name. A FeatureArray created with these
parameters will not allow variable FeatureTypes to be inserted into the
array, and will not allow variable Feature names to be used. Specifying
the Feature name and FeatureType ahead of time reduces the amount of
information tracked by the array, as well as the amount of information
that must be serialized.dimensions
- A list of dimensions. For example, passing {10} would
create a 1D array with 10 elements. Passing {10, 100} would create a 2D
array with a total of 1000 elements.public FeatureArray(FeatureType type, int... dimensions)
FeatureType
. A FeatureArray created with these parameters will
not allow variable FeatureTypes to be inserted into the array.dimensions
- A list of dimensions. For example, passing {10} would
create a 1D array with 10 elements. Passing {10, 100} would create a 2D
array with a total of 1000 elements.public FeatureArray(int... dimensions)
dimensions
- A list of dimensions. For example, passing {10} would
create a 1D array with 10 elements. Passing {10, 100} would create a 2D
array with a total of 1000 elements.public FeatureArray(java.lang.String name, java.lang.Object features)
name
- Name of the Features in this FeatureArrayfeatures
- Java array containing feature values@ByteSerializable.Deserialize public FeatureArray(galileo.serialization.SerializationInputStream in) throws java.io.IOException
java.io.IOException
public Feature get(int... indices)
public void set(Feature feature, int... indices)
public void erase(int... indices)
public boolean isNamed()
public java.lang.String getName()
public boolean isTyped()
public FeatureType getType()
public int getRank()
public int[] getDimensions()
public int getSize()
public void serialize(galileo.serialization.SerializationOutputStream out) throws java.io.IOException
serialize
in interface galileo.serialization.ByteSerializable
java.io.IOException