com.metsci.glimpse.util
Class PrimitiveVector.Double
java.lang.Object
com.metsci.glimpse.util.PrimitiveVector
com.metsci.glimpse.util.PrimitiveVector.Double
- Enclosing class:
- PrimitiveVector
public static class PrimitiveVector.Double
- extends PrimitiveVector
Method Summary |
void |
add(double x)
|
void |
add(double[] x)
|
void |
add(double[] x,
int start,
int len)
|
void |
add(double x,
double y)
|
void |
add(double x,
double y,
double z)
|
void |
add(float[] x)
|
void |
add(float[] x,
int start,
int len)
|
int |
capacity()
Returns the size of the underlying array. |
double |
get(int i)
|
double |
getAsDouble(int i)
|
double[] |
getCopiedData()
|
double[] |
getUnderlyingData()
|
void |
removeAll()
Removes all elements from the vector. |
int |
size()
Returns the number of elements stored in this array. |
void |
trimToSize()
Copies the data into a new underlying array of minimum sufficient size. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PrimitiveVector.Double
public PrimitiveVector.Double()
PrimitiveVector.Double
public PrimitiveVector.Double(int initialCapacity)
add
public final void add(double x)
add
public final void add(double x,
double y)
add
public final void add(double x,
double y,
double z)
add
public final void add(double[] x)
add
public final void add(float[] x)
add
public final void add(double[] x,
int start,
int len)
add
public final void add(float[] x,
int start,
int len)
getUnderlyingData
public final double[] getUnderlyingData()
getCopiedData
public final double[] getCopiedData()
get
public final double get(int i)
size
public final int size()
- Description copied from class:
PrimitiveVector
- Returns the number of elements stored in this array.
capacity
public final int capacity()
- Description copied from class:
PrimitiveVector
- Returns the size of the underlying array.
getAsDouble
public final double getAsDouble(int i)
removeAll
public void removeAll()
- Description copied from class:
PrimitiveVector
- Removes all elements from the vector.
trimToSize
public void trimToSize()
- Description copied from class:
PrimitiveVector
- Copies the data into a new underlying array of minimum sufficient size.
Typically there will be unused slots in the underlying array,
causing the PrimitiveVector
to use more memory than
necessary. Calling this function eliminates this overhead; however,
calling it too often will reduce performance.
NOTE: For large arrays, calling this method will temporarily
double its memory footprint for the the purpose of copying.
Copyright © 2012 Metron, Inc.. All Rights Reserved.