public class StringArray
extends java.util.ArrayList<java.lang.String>
| Constructor and Description |
|---|
StringArray()
constructor
|
StringArray(java.util.Collection<java.lang.String> m)
constructor
|
StringArray(java.lang.String strIn)
convenience - constructs a VString by tokenizing a string
|
StringArray(java.lang.String[] a)
creates a VString from an array of Strings
|
StringArray(java.lang.String strIn,
java.lang.String strSep)
constructs a VString by tokenizing a string
|
| Modifier and Type | Method and Description |
|---|---|
void |
addAll(java.lang.String[] strings)
appends all strings of an array to
this |
void |
addNonEmpty(java.lang.String text)
add a string if it is not empty
|
void |
appendUnique(java.util.Collection<java.lang.String> v)
AppendUnique - append a vector but ignore multiple entries
|
void |
appendUnique(java.lang.String string)
AppendUnique - append a string but ignore multiple entries
|
boolean |
containsAny(java.util.Collection<java.lang.String> others)
checks whether at least one of a given vector of strings is contained in
this |
java.lang.String |
get(int index) |
StringArray |
getOverlapping(java.util.Collection<java.lang.String> others)
vector of strings that is contained in
this |
java.util.Set<java.lang.String> |
getSet()
gets a set with all entries of the VString
note that the set retains ordering (LinkedHashSet) |
java.lang.String |
getString()
serialize to a string
|
java.lang.String |
getString(java.lang.String sep,
java.lang.String front,
java.lang.String back)
serialize to a string
|
static StringArray |
getVString(java.lang.String strIn,
java.lang.String strSep)
simple static factory - null if strIn is null or empty
|
static boolean |
isEmpty(java.util.Collection<java.lang.String> v)
are we null or empty or contain only an empty JDFAttributeMap
|
java.lang.String |
remove(int index)
remove but also implementing the usual neg number syntax
|
void |
unify()
unify - make VString unique, retaining initial order
|
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, forEach, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, removeAll, removeIf, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSizepublic StringArray()
public StringArray(java.util.Collection<java.lang.String> m)
m - public StringArray(java.lang.String strIn)
strIn - the string to tokenize by blankpublic StringArray(java.lang.String strIn,
java.lang.String strSep)
strIn - the string to tokenizestrSep - the separator characterpublic StringArray(java.lang.String[] a)
a - the arraypublic static boolean isEmpty(java.util.Collection<java.lang.String> v)
v - public static StringArray getVString(java.lang.String strIn, java.lang.String strSep)
strIn - strSep - public java.lang.String get(int index)
get in interface java.util.List<java.lang.String>get in class java.util.ArrayList<java.lang.String>index - the index which may be negative to count backwardspublic void appendUnique(java.lang.String string)
string - the string to append, if null nothing is addedpublic void appendUnique(java.util.Collection<java.lang.String> v)
v - the vector to append, if null nothing is addedpublic java.lang.String getString(java.lang.String sep,
java.lang.String front,
java.lang.String back)
sep - separator between stringsfront - string before the first entryback - string after the last entrypublic java.lang.String getString()
sep - separator between stringsfront - string before the first entryback - string after the last entrypublic void unify()
public java.util.Set<java.lang.String> getSet()
public void addAll(java.lang.String[] strings)
thisstrings - the array of strings to append to thispublic boolean containsAny(java.util.Collection<java.lang.String> others)
thisothers - the VSTring of values to testthispublic StringArray getOverlapping(java.util.Collection<java.lang.String> others)
thisothers - the VString of values to testthispublic java.lang.String remove(int index)
remove in interface java.util.List<java.lang.String>remove in class java.util.ArrayList<java.lang.String>index - if 0, or positive count from front, else if negative from backVector.remove(int)public void addNonEmpty(java.lang.String text)
text -