Class iicm.vrml.pwutils.CharArray
All Packages Class Hierarchy This Package Previous Next Index
Class iicm.vrml.pwutils.CharArray
java.lang.Object
|
+----iicm.vrml.pwutils.CharArray
- public class CharArray
- extends Object
CharArray - dynamic array of char type values
better time and memory efficiency than Vector,
char[] accessible in native code
Copyright (c) 1996 IICM
-
CharArray()
- create with default length
-
CharArray(char[])
- copy initial data from another char[].
-
CharArray(CharArray)
- copy initial data from another CharArray (non-null).
-
CharArray(int)
- create with initial buffer length
-
append(char)
- append one char element
-
clearData()
- clear the array
-
getCount()
- get count of used array members.
-
getData()
- get data array.
-
setData(char[])
- copy data from a char[]
-
setData(char[], int)
- copy first n elements of a char[]
-
setData(CharArray)
- copy data from another CharArray
-
setSize(int)
- set number of used array elements (ensures there is enough storage)
CharArray
public CharArray()
- create with default length
CharArray
public CharArray(int len)
- create with initial buffer length
CharArray
public CharArray(char dat[])
- copy initial data from another char[]. To say it again:
values in char[] are *copied* and not just referenced by this class
CharArray
public CharArray(CharArray dat)
- copy initial data from another CharArray (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(CharArray dat)
- copy data from another CharArray
setData
public void setData(char dat[])
- copy data from a char[]
setData
public synchronized void setData(char dat[],
int n)
- copy first n elements of a char[]
getCount
public final synchronized int getCount()
- get count of used array members.
Note: may be smaller than data_.length
getData
public final synchronized char[] 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(char d)
- append one char 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