|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectvisad.util.FloatTupleArrayImpl
public class FloatTupleArrayImpl
Growable array of float tuples.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface visad.util.FloatTupleArray |
|---|
FloatTupleArray.Factory |
| Field Summary | |
|---|---|
static float |
DEF_GROW_FACTOR
Factor by which the arrays are grown when they run out of space. |
protected float[][] |
elements
|
| Constructor Summary | |
|---|---|
FloatTupleArrayImpl(int dim,
int initialSize)
|
|
FloatTupleArrayImpl(int dim,
int initialSize,
float growFactor)
Construct an instance of initialSize. |
|
| Method Summary | |
|---|---|
void |
add(float[][] values)
Add values. |
void |
add(float[][] values,
int start,
int num)
Add values. |
int |
dim()
Get the dimension of the tuple. |
float[][] |
elements()
Reference to the backing data array. |
float[] |
get(int idx)
Get a tuple. |
float |
get(int i,
int j)
Get a value. |
protected void |
grow()
Grow the internal arrays. |
void |
set(int i,
int j,
float val)
Set a value. |
int |
size()
Get the size of the valid data. |
float[][] |
toArray()
Get contained data as array. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final float DEF_GROW_FACTOR
protected float[][] elements
| Constructor Detail |
|---|
public FloatTupleArrayImpl(int dim,
int initialSize)
public FloatTupleArrayImpl(int dim,
int initialSize,
float growFactor)
initialSize.
dim - The tuple dimension.initialSize - The initial size of the internal array.growFactor - Factor to grow by when resizing is necessary.| Method Detail |
|---|
protected void grow()
System.arraycopy is used for array
expansion.
public void add(float[][] values,
int start,
int num)
add in interface FloatTupleArrayvalues - Source array.start - index in the source array to start atnum - number of values to add.public float[][] elements()
elements in interface FloatTupleArraypublic void add(float[][] values)
add in interface FloatTupleArrayvalues - Source array.
public void set(int i,
int j,
float val)
set in interface FloatTupleArrayi - dimension index of the values to setj - tuple index of the value to setval - the valuepublic float[] get(int idx)
idx - The index of the tuple
public float get(int i,
int j)
get in interface FloatTupleArrayi - dimension indexj - tuple index.
i at tuple index j.public float[][] toArray()
NOTE: This is an expensive operation.
toArray in interface FloatTupleArraypublic int size()
size in interface FloatTupleArraypublic int dim()
dim in interface FloatTupleArray
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||