public class StringList extends Array<java.lang.String>
| Constructor and Description |
|---|
StringList()
Creates an empty StringList.
|
StringList(java.util.Collection<java.lang.String> coll)
Creates a StringList from the given collection.
|
StringList(java.lang.String... ary)
Creates a StringList from the given varargs.
|
| Modifier and Type | Method and Description |
|---|---|
StringList |
allContaining(java.lang.String substr)
Returns all strings in this list containing the given one.
|
StringList |
allEndingWith(java.lang.String substr)
Returns all strings in this list ending with the given one.
|
StringList |
allStartingWith(java.lang.String substr)
Returns all strings in this list starting with the given one.
|
boolean |
anyContains(java.lang.String substr)
Returns whether any string in this list contains the given one.
|
boolean |
anyEndsWith(java.lang.String substr)
Returns whether any string in this list ends with the given one.
|
boolean |
anyEqualsIgnoreCase(java.lang.String str)
Returns whether any element matches the given one, without regard to case.
|
boolean |
anyStartsWith(java.lang.String substr)
Returns whether any string in this list starts with the given one.
|
static StringList |
empty()
Creates an empty StringList.
|
StringList |
findAll(Closure<java.lang.Boolean,java.lang.String> criteria)
Returns all strings in the list for which the closure returns true.
|
java.lang.String |
findFirst(Closure<java.lang.Boolean,java.lang.String> criteria)
Returns the first string in the list for which the closure returns true.
|
java.lang.Boolean |
hasMatch(Closure<java.lang.Boolean,java.lang.String> criteria)
Returns whether the given criteria matches any element in the list.
|
static StringList |
of(java.lang.String... args)
Creates a new StringList.
|
StringList |
sort()
Returns a copy of this string list, sorted.
|
StringList |
toLines()
Returns the string list as lines, which have the current end-of-line character(s) for the
current OS, for any element that does not already have an EOLN character.
|
append, compact, containsAny, containsAny, elements, first, get, get, getRandomElement, intersection, join, last, minus, of, plus, removeAll, set, sorted, takeFirst, takeLast, toStringArrayList, toStringList, uniqueadd, add, addAll, addAll, clear, clone, contains, ensureCapacity, forEach, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, removeRange, replaceAll, retainAll, size, sort, spliterator, subList, toArray, toArray, trimToSizefinalize, getClass, notify, notifyAll, wait, wait, waitpublic StringList()
public StringList(java.util.Collection<java.lang.String> coll)
coll - the collection of strings to populate this array.public StringList(java.lang.String... ary)
ary - the strings to populate the new arraypublic static StringList of(java.lang.String... args)
args - the strings to populate the new arraypublic static StringList empty()
public boolean anyStartsWith(java.lang.String substr)
substr - the substring to matchpublic boolean anyContains(java.lang.String substr)
substr - the substring to matchpublic boolean anyEndsWith(java.lang.String substr)
substr - the substring to matchpublic boolean anyEqualsIgnoreCase(java.lang.String str)
str - the substring to matchpublic StringList allStartingWith(java.lang.String substr)
substr - the substring to matchpublic StringList allContaining(java.lang.String substr)
substr - the substring to matchpublic StringList allEndingWith(java.lang.String substr)
substr - the substring to matchpublic java.lang.String findFirst(Closure<java.lang.Boolean,java.lang.String> criteria)
public java.lang.Boolean hasMatch(Closure<java.lang.Boolean,java.lang.String> criteria)
public StringList findAll(Closure<java.lang.Boolean,java.lang.String> criteria)
criteria - the selection criteriaCriteriapublic StringList toLines()
public StringList sort()