public abstract class AbstractVector<T extends Number> extends Object implements Vector<T>
Vector
. Vector
implementations need
only implement Vector.length()
and Vector.getValue(int)
functionality to be
read-only vectors.Constructor and Description |
---|
AbstractVector() |
Modifier and Type | Method and Description |
---|---|
double |
add(int index,
double delta)
Throws an
UnsupportedOperationException if called (vector is
unmodifiable). |
boolean |
equals(Object o)
Returns
true if the object is a Vector of the same length
and whose corresponding indices have equivalent values. |
int |
hashCode()
Returns the hash code as the sum of the vectors elements, normalized to
an
int . |
double |
magnitude()
Returns the magnitude of this vector
|
void |
set(int index,
Number value)
Set the value in the vector (optional operation).
|
String |
toString()
Returns a string description of the full contents of this vector
|
public double add(int index, double delta)
UnsupportedOperationException
if called (vector is
unmodifiable).public boolean equals(Object o)
true
if the object is a Vector
of the same length
and whose corresponding indices have equivalent values.public int hashCode()
int
.public double magnitude()
public void set(int index, Number value)
Copyright © 2012. All Rights Reserved.