Class StringList
- All Implemented Interfaces:
Serializable, Cloneable, Iterable<String>, Collection<String>, List<String>, RandomAccess, SequencedCollection<String>
-
Field Summary
Fields inherited from class AbstractList
modCount -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidstatic StringNon-static version, that joins "this" StringList.static Stringjoin(Collection<String> c, String delim) The reverse of split - given a collection, takes each element and places it in a string, joined by a delimiter.static voidstatic StringListString[]toArray()toString()Joins each string in the list with a newline.Methods inherited from class ArrayList
add, add, addAll, addAll, addFirst, addLast, clear, clone, contains, ensureCapacity, equals, forEach, get, getFirst, getLast, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeFirst, removeIf, removeLast, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, trimToSizeMethods inherited from class AbstractCollection
containsAllMethods inherited from interface Collection
parallelStream, stream, toArrayMethods inherited from interface List
containsAll, reversed
-
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:
toStringin classAbstractCollection<String>- Returns:
- a joined string representation of this, with the newline (\n) as delimiter.
-
toArray
-
join
The reverse of split - given a collection, takes each element and places it in a string, joined by a delimiter. -
join
-
join
-
main
-