|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Vector
Interface for vectors holding double elements. A vector has a growable number of cells (its size). Elements are accessed via zero based indexes. Legal indexes are of the form [0..size()-1]. Any attempt to access an element at a coordinate index<0 || index>=size() will throw an IndexOutOfBoundsException.
Method Summary | |
---|---|
void |
add(int index,
double value)
Inserts the specified element at the specified position in this vector. |
double |
dotProduct(Vector v)
Returns an iterator over the elements in this vector in proper sequence (optional operation). |
int |
elementCount()
Returns the number of elements in this vector |
boolean |
existsIndex(int index)
Returns a boolean denoting whether this index already exists in the vector. |
double |
get(int index)
Returns the element at the specified position in this vector. |
java.util.Iterator |
iterator()
Returns an iterator over the elements in this vector in proper sequence. |
double |
norm()
Returns the norm of this vector (optional operation). |
void |
normalize()
Normalizes this vector (optional operation). |
void |
set(int index,
double value)
Replaces the element at the specified position in this vectro with the specified element (optional operation). |
int |
size()
Returns the size of this vector. |
Method Detail |
---|
void add(int index, double value) throws java.lang.IndexOutOfBoundsException
index
- index at which the specified element
is to be inserted.value
- value to be inserted.
java.lang.IndexOutOfBoundsException
- if the index is out of range
(index < 0).double get(int index) throws java.lang.IndexOutOfBoundsException
index
- index of element to return.
java.lang.IndexOutOfBoundsException
- if the index is out of range
(index < 0 || index > size()).boolean existsIndex(int index) throws java.lang.IndexOutOfBoundsException
index
- index of element to return.
true
if and only if the index exists; false
otherwise
java.lang.IndexOutOfBoundsException
void set(int index, double value) throws java.lang.IndexOutOfBoundsException
index
- index of element to return.value
- value to be inserted.
java.lang.IndexOutOfBoundsException
- if the index is out of range
(index < 0 || index > size()).int size()
int elementCount()
java.util.Iterator iterator()
double dotProduct(Vector v)
double norm()
void normalize()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |