Class iicm.vrml.pwutils.DoubleArray
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class iicm.vrml.pwutils.DoubleArray

java.lang.Object
   |
   +----iicm.vrml.pwutils.DoubleArray

public class DoubleArray
extends Object
DoubleArray - dynamic array of double type values better time and memory efficiency than Vector, double[] accessible in native code Copyright (c) 1996 IICM

Constructor Index

 o DoubleArray()
create with default length
 o DoubleArray(double[])
copy initial data from another double[].
 o DoubleArray(DoubleArray)
copy initial data from another DoubleArray (non-null).
 o DoubleArray(int)
create with initial buffer length

Method Index

 o append(double)
append one double element
 o clearData()
clear the array
 o getCount()
get count of used array members.
 o getData()
get data array.
 o setData(double[])
copy data from a double[]
 o setData(double[], int)
copy first n elements of a double[]
 o setData(DoubleArray)
copy data from another DoubleArray
 o setSize(int)
set number of used array elements (ensures there is enough storage)

Constructors

 o DoubleArray
  public DoubleArray()
create with default length
 o DoubleArray
  public DoubleArray(int len)
create with initial buffer length
 o DoubleArray
  public DoubleArray(double dat[])
copy initial data from another double[]. To say it again: values in double[] are *copied* and not just referenced by this class
 o DoubleArray
  public DoubleArray(DoubleArray dat)
copy initial data from another DoubleArray (non-null). do not use the above constructor in this case, as it would use all values, not just the used length (count); again: values are *copied*

Methods

 o setData
  public void setData(DoubleArray dat)
copy data from another DoubleArray
 o setData
  public void setData(double dat[])
copy data from a double[]
 o setData
  public synchronized void setData(double dat[],
                                   int n)
copy first n elements of a double[]
 o getCount
  public final synchronized int getCount()
get count of used array members. Note: may be smaller than data_.length
 o getData
  public final synchronized double[] getData()
get data array. Only elements 0 to (getCount () - 1) were set by user. Subsequent calls (after enlargement) may return a different array object
 o append
  public synchronized void append(double d)
append one double element
 o setSize
  public synchronized void setSize(int n)
set number of used array elements (ensures there is enough storage)
 o clearData
  public synchronized boolean clearData()
clear the array
Returns:
true if the array was previously non-empty

All Packages  Class Hierarchy  This Package  Previous  Next  Index