de.lmu.ifi.dbs.elki.data
Class NumberVector<V extends NumberVector<V,N>,N extends Number>
java.lang.Object
de.lmu.ifi.dbs.elki.data.AbstractDatabaseObject
de.lmu.ifi.dbs.elki.data.NumberVector<V,N>
- Type Parameters:
V
- the concrete type of this NumberVectorN
- the type of number, this NumberVector consists of (i.e., a
NumberVector v
of type V
and dimensionality d
is an element of N
d
)
- All Implemented Interfaces:
- DatabaseObject, FeatureVector<V,N>, SpatialComparable, SpatialObject
- Direct Known Subclasses:
- BitVector, RealVector
public abstract class NumberVector<V extends NumberVector<V,N>,N extends Number>
- extends AbstractDatabaseObject
- implements FeatureVector<V,N>
NumberVector is an abstract implementation of FeatureVector. Provided is an
attribute separator (space), and the ID-methods as required for a
DatabaseObject. The equals-method is implemented dynamically for all
subclasses to satisfy the requirements as defined in
DatabaseObject.equals(Object)
. It needs
not to be overwritten except for sake of efficiency.
- Author:
- Arthur Zimek
Field Summary |
static String |
ATTRIBUTE_SEPARATOR
The String to separate attribute values in a String that represents the
values. |
Method Summary |
boolean |
equals(Object obj)
An Object obj is equal to this NumberVector if it is an instance of the
same runtime class and is of the identical dimensionality and the values of
this NumberVector are equal to the values of obj in all dimensions,
respectively. |
double |
getMax(int dimension)
Returns the maximum coordinate at the specified dimension. |
double |
getMin(int dimension)
Returns the minimum coordinate at the specified dimension. |
double[] |
getRange()
Return the range across all dimensions. |
Methods inherited from interface de.lmu.ifi.dbs.elki.data.FeatureVector |
getColumnVector, getDimensionality, getRowVector, getValue, multiplicate, negativeVector, newInstance, newInstance, nullVector, plus, randomInstance, randomInstance, randomInstance, toString |
Methods inherited from interface de.lmu.ifi.dbs.elki.index.tree.spatial.SpatialObject |
getID |
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
NumberVector
public NumberVector()
equals
public boolean equals(Object obj)
- An Object obj is equal to this NumberVector if it is an instance of the
same runtime class and is of the identical dimensionality and the values of
this NumberVector are equal to the values of obj in all dimensions,
respectively.
- Specified by:
equals
in interface DatabaseObject
- 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
NumberVector are equal to the values of obj in all dimensions,
respectively
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 value at the specified dimension
- See Also:
FeatureVector.getValue(int)
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 value at the specified dimension
- See Also:
FeatureVector.getValue(int)
getRange
public double[] getRange()
- Return the range across all dimensions. Sensible for time series.
- Returns:
- [min, max]