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

Class iicm.vrml.pwutils.StringArray

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

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

Constructor Index

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

Method Index

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

Constructors

 o StringArray
  public StringArray()
create with default length
 o StringArray
  public StringArray(int len)
create with initial buffer length
 o StringArray
  public StringArray(String dat[])
copy initial data from another String[]. To say it again: values in String[] are *copied* and not just referenced by this class
 o StringArray
  public StringArray(StringArray dat)
copy initial data from another StringArray (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(StringArray dat)
copy data from another StringArray
 o setData
  public void setData(String dat[])
copy data from a String[]
 o setData
  public synchronized void setData(String dat[],
                                   int n)
copy first n elements of a String[]
 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 String[] 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(String d)
append one String 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