com.metsci.glimpse.util
Class PrimitiveVector.Long

java.lang.Object
  extended by com.metsci.glimpse.util.PrimitiveVector
      extended by com.metsci.glimpse.util.PrimitiveVector.Long
Enclosing class:
PrimitiveVector

public static class PrimitiveVector.Long
extends PrimitiveVector


Nested Class Summary
 
Nested classes/interfaces inherited from class com.metsci.glimpse.util.PrimitiveVector
PrimitiveVector.Double, PrimitiveVector.Float, PrimitiveVector.Integer, PrimitiveVector.Long
 
Constructor Summary
PrimitiveVector.Long()
           
PrimitiveVector.Long(int initialCapacity)
           
 
Method Summary
 void add(long x)
           
 void add(long[] x)
           
 void add(long[] x, int start, int len)
           
 void add(PrimitiveVector.Long x)
           
 int capacity()
          Returns the size of the underlying array.
 long get(int i)
           
 double getAsDouble(int i)
           
 long[] getCopiedData()
           
 long[] 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
 

Constructor Detail

PrimitiveVector.Long

public PrimitiveVector.Long()

PrimitiveVector.Long

public PrimitiveVector.Long(int initialCapacity)
Method Detail

add

public final void add(long x)

add

public final void add(long[] x)

add

public final void add(long[] x,
                      int start,
                      int len)

add

public final void add(PrimitiveVector.Long x)

getUnderlyingData

public final long[] getUnderlyingData()

getCopiedData

public final long[] getCopiedData()

get

public final long 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.