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
-
StringArray()
- create with default length
-
StringArray(int)
- create with initial buffer length
-
StringArray(String[])
- copy initial data from another String[].
-
StringArray(StringArray)
- copy initial data from another StringArray (non-null).
-
append(String)
- append one String element
-
clearData()
- clear the array
-
getCount()
- get count of used array members.
-
getData()
- get data array.
-
setData(String[])
- copy data from a String[]
-
setData(String[], int)
- copy first n elements of a String[]
-
setData(StringArray)
- copy data from another StringArray
-
setSize(int)
- set number of used array elements (ensures there is enough storage)
StringArray
public StringArray()
- create with default length
StringArray
public StringArray(int len)
- create with initial buffer length
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
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*
setData
public void setData(StringArray dat)
- copy data from another StringArray
setData
public void setData(String dat[])
- copy data from a String[]
setData
public synchronized void setData(String dat[],
int n)
- copy first n elements of a String[]
getCount
public final synchronized int getCount()
- get count of used array members.
Note: may be smaller than data_.length
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
append
public synchronized void append(String d)
- append one String element
setSize
public synchronized void setSize(int n)
- set number of used array elements (ensures there is enough storage)
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