public class IntegerVector extends AbstractNumberVector<IntegerVector,Integer> implements ByteBufferSerializer<IntegerVector>
Modifier and Type | Class and Description |
---|---|
static class |
IntegerVector.Parameterizer
Parameterization class
|
Modifier and Type | Field and Description |
---|---|
static IntegerVector |
STATIC
Static instance (object factory)
|
private int[] |
values
Keeps the values of the real vector
|
ATTRIBUTE_SEPARATOR
Modifier | Constructor and Description |
---|---|
|
IntegerVector(int[] values)
Provides an IntegerVector consisting of the given integer values.
|
private |
IntegerVector(int[] values,
boolean nocopy)
Private constructor.
|
Modifier and Type | Method and Description |
---|---|
double |
doubleValue(int dimension)
Returns the value of the specified attribute.
|
IntegerVector |
fromByteBuffer(ByteBuffer buffer)
Deserialize an object from a byte buffer (e.g. disk)
|
int |
getByteSize(IntegerVector vec)
Get the size of the object in bytes.
|
Vector |
getColumnVector()
Returns a Vector representing in one column and
getDimensionality() rows the values of this NumberVector of V. |
int |
getDimensionality()
The dimensionality of the vector space where of this FeatureVector of V is
an element.
|
Integer |
getValue(int dimension)
Returns the value of the specified attribute.
|
int[] |
getValues()
Get a copy of the raw int[] array.
|
long |
longValue(int dimension)
Returns the value of the specified attribute as long.
|
<A> IntegerVector |
newFeatureVector(A array,
ArrayAdapter<Integer,A> adapter)
Returns a new FeatureVector of V for the given values.
|
<A> IntegerVector |
newNumberVector(A array,
NumberArrayAdapter<?,A> adapter)
Instantiate from any number-array like object.
|
void |
toByteBuffer(ByteBuffer buffer,
IntegerVector vec)
Serialize the object to a byte array (e.g. disk)
|
String |
toString()
Returns a String representation of the FeatureVector of V as a line that is
suitable to be printed in a sequential file.
|
byteValue, equals, floatValue, getMax, getMin, hashCode, intValue, newNumberVector, shortValue
public static final IntegerVector STATIC
private int[] values
private IntegerVector(int[] values, boolean nocopy)
public IntegerVector(int[] values)
values
- the values to be set as values of the IntegerVectorpublic int getDimensionality()
FeatureVector
getDimensionality
in interface FeatureVector<IntegerVector,Integer>
getDimensionality
in interface SpatialComparable
public Integer getValue(int dimension)
getValue
in interface FeatureVector<IntegerVector,Integer>
dimension
- the selected attribute. Attributes are counted starting
with 1.IllegalArgumentException
- if the specified dimension is out of range
of the possible attributespublic double doubleValue(int dimension)
doubleValue
in interface NumberVector<IntegerVector,Integer>
dimension
- the selected attribute. Attributes are counted starting
with 1.IllegalArgumentException
- if the specified dimension is out of range
of the possible attributespublic long longValue(int dimension)
longValue
in interface NumberVector<IntegerVector,Integer>
dimension
- the selected attribute. Attributes are counted starting
with 1.IllegalArgumentException
- if the specified dimension is out of range
of the possible attributespublic int[] getValues()
public Vector getColumnVector()
NumberVector
getDimensionality()
rows the values of this NumberVector of V.getColumnVector
in interface NumberVector<IntegerVector,Integer>
getDimensionality()
rows the values of this
NumberVector of Vpublic String toString()
FeatureVector
toString
in interface FeatureVector<IntegerVector,Integer>
toString
in class Object
public <A> IntegerVector newFeatureVector(A array, ArrayAdapter<Integer,A> adapter)
FeatureVector
newFeatureVector
in interface FeatureVector<IntegerVector,Integer>
A
- Array typearray
- the values of the featureVectoradapter
- adapter classpublic <A> IntegerVector newNumberVector(A array, NumberArrayAdapter<?,A> adapter)
NumberVector
newNumberVector
in interface NumberVector<IntegerVector,Integer>
A
- Array typearray
- Arrayadapter
- Adapterpublic IntegerVector fromByteBuffer(ByteBuffer buffer) throws IOException
ByteBufferSerializer
fromByteBuffer
in interface ByteBufferSerializer<IntegerVector>
buffer
- Data array to processIOException
public void toByteBuffer(ByteBuffer buffer, IntegerVector vec) throws IOException
ByteBufferSerializer
toByteBuffer
in interface ByteBufferSerializer<IntegerVector>
buffer
- Buffer to serialize tovec
- Object to serializeIOException
public int getByteSize(IntegerVector vec)
ByteBufferSerializer
getByteSize
in interface ByteBufferSerializer<IntegerVector>
vec
- Object to serialize