- All Implemented Interfaces:
Serializable
,Cloneable
,Iterable<String>
,Collection<String>
,List<String>
,RandomAccess
A List<String> with some perl-like convenience functions (split/join primarily),
and easy conversion to/from arrays.
- Since:
- jEdit 4.3pre7
- See Also:
-
Field Summary
Fields inherited from class java.util.AbstractList
modCount
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
static String
Non-static version, that joins "this" StringList.static String
join
(Collection<String> c, String delim) Deprecated.static StringList
String[]
toArray()
toString()
Joins each string in the list with a newline.Methods inherited from class java.util.ArrayList
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, equals, forEach, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, trimToSize
Methods inherited from class java.util.AbstractCollection
containsAll
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Collection
parallelStream, stream, toArray
Methods inherited from interface java.util.List
containsAll
-
Constructor Details
-
StringList
public StringList() -
StringList
-
-
Method Details
-
addAll
-
split
- Parameters:
orig
- the original stringdelim
- a delimiter to use for splitting- Returns:
- a new StringList containing the split strings.
-
toString
Joins each string in the list with a newline.- Overrides:
toString
in classAbstractCollection<String>
- Returns:
- a joined string representation of this, with the newline (\n) as delimiter.
-
toArray
-
join
Deprecated.useString.join(CharSequence, CharSequence...)
orString.join(CharSequence, Iterable)
, thos methods are available since Java 8 and are faster in all situationsThe reverse of split - given a collection, takes each element and places it in a string, joined by a delimiter. -
join
- Parameters:
arr
- array of objectsdelim
- delimiter to separate strings- Returns:
- a single string with each element in arr converted to a string and concatenated, separated by delim.
-
join
Non-static version, that joins "this" StringList.- Parameters:
delim
- the delimiter- Returns:
- a joined string with delim inbetween each element
-
String.join(CharSequence, CharSequence...)
orString.join(CharSequence, Iterable)
, thos methods are available since Java 8 and are faster in all situations