|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.graphbuilder.curve.ValueVector
A value-vector is a sequence of values that some curves use to define themselves, sometimes called a knot-vector or a weight-vector. The values are stored using an array.
Field Summary | |
protected int |
size
|
protected double[] |
value
|
Constructor Summary | |
ValueVector()
Creates a ValueVector with initial capacity of 2. |
|
ValueVector(double[] value,
int size)
Creates a ValueVector using the specified array and initial size. |
|
ValueVector(int initialCapacity)
Creates a ValueVector with the specified initial capacity. |
Method Summary | |
void |
add(double d)
Adds a value to the value array at index location size. |
void |
ensureCapacity(int capacity)
Checks that the value array has the specified capacity, otherwise the capacity of the value array is increased to be the maximum between twice the current capacity and the specified capacity. |
double |
get(int index)
Returns the value at the specified index. |
void |
insert(double d,
int index)
Inserts the value at the specified index location. |
void |
remove(int index)
Removes the value at the specified index. |
void |
set(double d,
int index)
Sets the value at the specified index. |
int |
size()
Returns the number of values in the value array. |
void |
trimArray()
Creates a new value array of exact size, copying the values from the old array into the new one. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected int size
protected double[] value
Constructor Detail |
public ValueVector()
public ValueVector(double[] value, int size)
java.lang.IllegalArgumentException
- If the value array is null or size < 0 or size > data.length.public ValueVector(int initialCapacity)
Method Detail |
public int size()
public double get(int index)
java.lang.IllegalArgumentException
- If index < 0 or index >= size.public void set(double d, int index)
java.lang.IllegalArgumentException
- If index < 0 or index >= size.public void remove(int index)
java.lang.IllegalArgumentException
- If index < 0 or index >= size.public void add(double d)
public void insert(double d, int index)
java.lang.IllegalArgumentException
- If index < 0 or index > size.public void ensureCapacity(int capacity)
public void trimArray()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |