de.lmu.ifi.dbs.elki.data
Class AbstractNumberVector<V extends AbstractNumberVector<? extends V,N>,N extends Number>

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.data.AbstractNumberVector<V,N>
Type Parameters:
V - the concrete type of this AbstractNumberVector
N - the type of number, this AbstractNumberVector consists of (i.e., a AbstractNumberVector v of type V and dimensionality d is an element of Nd)
All Implemented Interfaces:
FeatureVector<V,N>, NumberVector<V,N>, SpatialComparable
Direct Known Subclasses:
BitVector, DoubleVector, FloatVector, IntegerVector, OneDimensionalDoubleVector, SparseFloatVector

public abstract class AbstractNumberVector<V extends AbstractNumberVector<? extends V,N>,N extends Number>
extends Object
implements NumberVector<V,N>

AbstractNumberVector is an abstract implementation of FeatureVector.


Field Summary
static String ATTRIBUTE_SEPARATOR
          The String to separate attribute values in a String that represents the values.
 
Constructor Summary
AbstractNumberVector()
           
 
Method Summary
 byte byteValue(int dimension)
          Returns the value in the specified dimension as byte.
 boolean equals(Object obj)
          An Object obj is equal to this AbstractNumberVector if it is an instance of the same runtime class and is of the identical dimensionality and the values of this AbstractNumberVector are equal to the values of obj in all dimensions, respectively.
 float floatValue(int dimension)
          Returns the value in the specified dimension as float.
 double getMax(int dimension)
          Returns the maximum coordinate at the specified dimension.
 double getMin(int dimension)
          Returns the minimum coordinate at the specified dimension.
 int hashCode()
           
 int intValue(int dimension)
          Returns the value in the specified dimension as int.
 short shortValue(int dimension)
          Returns the value in the specified dimension as short.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface de.lmu.ifi.dbs.elki.data.NumberVector
doubleValue, getColumnVector, getRowVector, longValue, minus, multiplicate, negativeVector, newInstance, newInstance, nullVector, plus, scalarProduct
 
Methods inherited from interface de.lmu.ifi.dbs.elki.data.FeatureVector
getDimensionality, getValue, newInstance, newInstance, toString
 
Methods inherited from interface de.lmu.ifi.dbs.elki.data.spatial.SpatialComparable
getDimensionality
 

Field Detail

ATTRIBUTE_SEPARATOR

public static final String ATTRIBUTE_SEPARATOR
The String to separate attribute values in a String that represents the values.

See Also:
Constant Field Values
Constructor Detail

AbstractNumberVector

public AbstractNumberVector()
Method Detail

equals

public boolean equals(Object obj)
An Object obj is equal to this AbstractNumberVector if it is an instance of the same runtime class and is of the identical dimensionality and the values of this AbstractNumberVector are equal to the values of obj in all dimensions, respectively.

Overrides:
equals in class Object
Parameters:
obj - another Object
Returns:
true if the specified Object is an instance of the same runtime class and is of the identical dimensionality and the values of this AbstractNumberVector are equal to the values of obj in all dimensions, respectively

hashCode

public int hashCode()
Overrides:
hashCode in class Object

getMin

public double getMin(int dimension)
Description copied from interface: SpatialComparable
Returns the minimum coordinate at the specified dimension.

Specified by:
getMin in interface SpatialComparable
Parameters:
dimension - the dimension for which the coordinate should be returned, where 1 ≤ dimension ≤ getDimensionality()
Returns:
the minimum coordinate at the specified dimension

getMax

public double getMax(int dimension)
Description copied from interface: SpatialComparable
Returns the maximum coordinate at the specified dimension.

Specified by:
getMax in interface SpatialComparable
Parameters:
dimension - the dimension for which the coordinate should be returned, where 1 ≤ dimension ≤ getDimensionality()
Returns:
the maximum coordinate at the specified dimension

byteValue

public byte byteValue(int dimension)
Description copied from interface: NumberVector
Returns the value in the specified dimension as byte. Note: this might seem redundant with respect to getValue(dim).byteValue(), but usually this is much more efficient due to boxing/unboxing cost.

Specified by:
byteValue in interface NumberVector<V extends AbstractNumberVector<? extends V,N>,N extends Number>
Parameters:
dimension - the desired dimension, where 1 ≤ dimension ≤ this.getDimensionality()
Returns:
the value in the specified dimension

floatValue

public float floatValue(int dimension)
Description copied from interface: NumberVector
Returns the value in the specified dimension as float. Note: this might seem redundant with respect to getValue(dim).floatValue(), but usually this is much more efficient due to boxing/unboxing cost.

Specified by:
floatValue in interface NumberVector<V extends AbstractNumberVector<? extends V,N>,N extends Number>
Parameters:
dimension - the desired dimension, where 1 ≤ dimension ≤ this.getDimensionality()
Returns:
the value in the specified dimension

intValue

public int intValue(int dimension)
Description copied from interface: NumberVector
Returns the value in the specified dimension as int. Note: this might seem redundant with respect to getValue(dim).intValue(), but usually this is much more efficient due to boxing/unboxing cost.

Specified by:
intValue in interface NumberVector<V extends AbstractNumberVector<? extends V,N>,N extends Number>
Parameters:
dimension - the desired dimension, where 1 ≤ dimension ≤ this.getDimensionality()
Returns:
the value in the specified dimension

shortValue

public short shortValue(int dimension)
Description copied from interface: NumberVector
Returns the value in the specified dimension as short. Note: this might seem redundant with respect to getValue(dim).shortValue(), but usually this is much more efficient due to boxing/unboxing cost.

Specified by:
shortValue in interface NumberVector<V extends AbstractNumberVector<? extends V,N>,N extends Number>
Parameters:
dimension - the desired dimension, where 1 ≤ dimension ≤ this.getDimensionality()
Returns:
the value in the specified dimension

Release 0.4.0 (2011-09-20_1324)