Gephi Toolkit Javadoc

org.gephi.data.attributes.type
Class StringList

java.lang.Object
  extended by org.gephi.data.attributes.type.AbstractList<java.lang.String>
      extended by org.gephi.data.attributes.type.StringList

public final class StringList
extends AbstractList<java.lang.String>

Complex type that define a list of String items. Can be created from a String array, from a char array or from single string using either given or default separators.

String list is useful when, for a particular type, the number of string that define an element is not known by advance.

Author:
Martin Ć kurla, Mathieu Bastian
See Also:
AttributeType

Field Summary
 
Fields inherited from class org.gephi.data.attributes.type.AbstractList
DEFAULT_SEPARATOR, list
 
Constructor Summary
StringList(char[] list)
          Create a new string from a char array.
StringList(java.lang.String input)
          Create a new string list with items found in the given value.
StringList(java.lang.String[] list)
          Create a new string list with the given items.
StringList(java.lang.String input, java.lang.String separator)
          Create a new string list with items found using given separators.
 
Method Summary
 java.lang.String getString(int index)
          Returns the item at the specified index.
 
Methods inherited from class org.gephi.data.attributes.type.AbstractList
contains, equals, getItem, hashCode, size, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

StringList

public StringList(char[] list)
Create a new string from a char array. One char per list cell.

Parameters:
list - the list

StringList

public StringList(java.lang.String[] list)
Create a new string list with the given items.

Parameters:
list - the list of string items

StringList

public StringList(java.lang.String input)
Create a new string list with items found in the given value. Default separators ,|; are used to split the string in a list.

Parameters:
input - a string with default separators

StringList

public StringList(java.lang.String input,
                  java.lang.String separator)
Create a new string list with items found using given separators.

Parameters:
input - a string with separators defined in separator
separator - the separators chars that are to be used to split value
Method Detail

getString

public java.lang.String getString(int index)
Returns the item at the specified index. May return null if index is out of range.

Parameters:
index - the position in the string list
Returns:
the item at the specified position, or null

Gephi Toolkit Javadoc