|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.mckoi.util.StringListBucket
public class StringListBucket
A utility container class for holding a list of strings. This method provides a convenient way of exporting and importing the list as a string itself. This is useful if we need to represent a variable array of strings.
Constructor Summary | |
---|---|
StringListBucket()
Constructs the bucket. |
|
StringListBucket(java.lang.String list)
|
Method Summary | |
---|---|
void |
add(java.lang.String element)
Adds a string to the end of the list. |
void |
add(java.lang.String element,
int index)
Adds a string to the given index of the list. |
void |
clear()
Clears the list of all string elements. |
boolean |
contains(java.lang.String element)
Returns true if the list contains the given element string. |
void |
fromString(java.lang.String list)
Imports from a String into this bucket. |
java.lang.String |
get(int index)
Returns the string at the given index of the list. |
int |
indexOfVar(java.lang.String element)
Returns the index of the given string in the bucket, or -1 if not found. |
void |
remove(int index)
Removes the string at the given index of the list. |
int |
size()
Returns the number of string elements in the list. |
java.lang.String |
toString()
|
java.lang.StringBuffer |
toStringBuffer()
Returns the bucket as a StringBuffer. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public StringListBucket()
public StringListBucket(java.lang.String list)
Method Detail |
---|
public int size()
public void clear()
public void add(java.lang.String element)
public void add(java.lang.String element, int index)
public java.lang.String get(int index)
public void remove(int index)
public boolean contains(java.lang.String element)
public int indexOfVar(java.lang.String element)
public java.lang.StringBuffer toStringBuffer()
public java.lang.String toString()
toString
in class java.lang.Object
public void fromString(java.lang.String list)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |