org.getopt.luke
Class GrowableStringArray
java.lang.Object
org.getopt.luke.GrowableStringArray
public class GrowableStringArray
- extends java.lang.Object
Simple Vector-like implementation of a growable String array.
- Author:
- Andrzej Bialecki
Method Summary |
void |
append(int index,
java.lang.String sep,
java.lang.String value)
Appends the separator and value at specified index. |
java.lang.String |
get(int index)
Return the value at specified index. |
void |
set(int index,
java.lang.String value)
Sets the value at specified index. |
int |
size()
|
java.lang.String |
toString(java.lang.String separator)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
INITIAL_SIZE
public int INITIAL_SIZE
GrowableStringArray
public GrowableStringArray()
size
public int size()
set
public void set(int index,
java.lang.String value)
- Sets the value at specified index. If index is outside range the array is automatically
expanded.
- Parameters:
index
- where to set the valuevalue
-
append
public void append(int index,
java.lang.String sep,
java.lang.String value)
- Appends the separator and value at specified index. If no value exists at the
specified position, this is equivalent to
set(int, String)
- no separator
is appended in that case.
- Parameters:
index
- selected positionsep
- separatorvalue
- value
get
public java.lang.String get(int index)
- Return the value at specified index.
- Parameters:
index
-
- Returns:
toString
public java.lang.String toString(java.lang.String separator)