org.getopt.luke
Class GrowableStringArray

java.lang.Object
  extended by org.getopt.luke.GrowableStringArray

public class GrowableStringArray
extends java.lang.Object

Simple Vector-like implementation of a growable String array.

Author:
Andrzej Bialecki

Field Summary
 int INITIAL_SIZE
           
 
Constructor Summary
GrowableStringArray()
           
 
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
 

Field Detail

INITIAL_SIZE

public int INITIAL_SIZE
Constructor Detail

GrowableStringArray

public GrowableStringArray()
Method Detail

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 value
value -

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 position
sep - separator
value - 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)