de.lmu.ifi.dbs.elki.data
Class NumberVector<V extends NumberVector<V,N>,N extends Number>
java.lang.Object
de.lmu.ifi.dbs.elki.logging.AbstractLoggable
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:
- WekaObject<WekaNumericAttribute>, DatabaseObject, FeatureVector<V,N>, SpatialComparable, SpatialObject, Loggable
- Direct Known Subclasses:
- BitVector, RealVector
public abstract class NumberVector<V extends NumberVector<V,N>,N extends Number>
- extends AbstractDatabaseObject
- implements FeatureVector<V,N>, WekaObject<WekaNumericAttribute>
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. |
WekaNumericAttribute[] |
getAttributes()
Returns the attributes as array of WekaNumericAttributes. |
double |
getMax(int dimension)
Returns the maximum coordinate at the specified dimension. |
double |
getMin(int dimension)
Returns the minimum coordinate at the specified dimension. |
V |
newInstance(N[] values)
Returns a new FeatureVector of T for the given values. |
Methods inherited from class de.lmu.ifi.dbs.elki.logging.AbstractLoggable |
debugFine, debugFiner, debugFinest, exception, message, progress, progress, progress, verbose, verbose, warning |
Methods inherited from interface de.lmu.ifi.dbs.elki.data.FeatureVector |
getColumnVector, getDimensionality, getRowVector, getValue, multiplicate, negativeVector, nullVector, plus, 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()
newInstance
public V newInstance(N[] values)
throws SecurityException,
NoSuchMethodException,
IllegalArgumentException,
InstantiationException,
IllegalAccessException,
InvocationTargetException
- Description copied from interface:
FeatureVector
- Returns a new FeatureVector of T for the given values.
- Specified by:
newInstance
in interface FeatureVector<V extends NumberVector<V,N>,N extends Number>
- Parameters:
values
- the values of the featureVector
- Returns:
- a new FeatureVector of T for the given values
- Throws:
SecurityException
NoSuchMethodException
IllegalArgumentException
InstantiationException
IllegalAccessException
InvocationTargetException
- See Also:
FeatureVector.newInstance(Number[])
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
- See Also:
DatabaseObject.equals(Object)
getAttributes
public WekaNumericAttribute[] getAttributes()
- Returns the attributes as array of WekaNumericAttributes.
- Specified by:
getAttributes
in interface WekaObject<WekaNumericAttribute>
- Returns:
- the attributes as array of WekaNumericAttributes
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:
SpatialComparable.getMin(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:
SpatialComparable.getMax(int)