StringList

All Methods Instance Methods Concrete Methods  Modifier and Type Method and Description void append(java.lang.String value)

Add a new entry to the list.

void append(java.lang.String[] values)  void append(StringList list)  void appendUnique(java.lang.String value)

Add this value, but only if it's not already in the list.

java.lang.String[] array()

Create a new array with a copy of all the values.

java.lang.String[] array(java.lang.String[] array)

Copy values into the specified array.

void clear()

Remove all entries from the list.

StringList copy()  java.lang.String get(int index)

Get an entry at a particular index.

IntDict getOrder()

Create a dictionary associating each entry in this list to its index.

StringList getSubset(int start)  StringList getSubset(int start, int num)  IntDict getTally()

Count the number of times each String entry is found in this list.

java.lang.String[] getUnique()

Get a list of all unique entries.

boolean hasValue(java.lang.String value)  int index(java.lang.String what)

Return the first index of a particular value.

void insert(int index, java.lang.String value)  void insert(int index, java.lang.String[] values)  void insert(int index, StringList list)  java.util.Iterator<java.lang.String> iterator()  java.lang.String join(java.lang.String separator)  void lower()

Make the entire list lower case.

java.lang.String pop()  void print()  void push(java.lang.String value)

Just an alias for append(), but matches pop()

java.lang.String remove(int index)

Remove an element from the specified index.

int removeValue(java.lang.String value)  int removeValues(java.lang.String value)  int replaceValue(java.lang.String value, java.lang.String newValue)  int replaceValues(java.lang.String value, java.lang.String newValue)  void resize(int length)  void reverse()  void save(java.io.File file)

Save tab-delimited entries to a file (TSV format, UTF-8 encoding)

void set(int index, java.lang.String what)

Set the entry at a particular index.

void shuffle()

Randomize the order of the list elements.

void shuffle(PApplet sketch)

Randomize the list order using the random() function from the specified sketch, allowing shuffle() to use its current randomSeed() setting.

int size()

Get the length of the list.

void sort()

Sorts the array in place.

void sortReverse()

Reverse sort, orders values from highest to lowest.

java.lang.String toJSON()

Return this dictionary as a String in JSON format.

java.lang.String toString()  void upper()

Make the entire list upper case.

java.lang.String[] values()

Returns the actual array being used to store the data.

void write(java.io.PrintWriter writer)

Write entries to a PrintWriter, one per line