Package com.storedobject.common
Class StringList
java.lang.Object
com.storedobject.common.StringList
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoidbooleanbooleanaddAll(int index, Collection<? extends String> c) booleanaddAll(Collection<? extends String> c) String[]array()Get a copy of the elements as an array.voidclear()concat(StringList another) Concatenate another list to this list.static StringListconcat(StringList... lists) Concatenate an array of lists.static StringListconcat(StringList first, StringList second) Concatenate 2 lists..Concatenate another list to this list.static StringListConcatenate an array of lists.concat(Collection<String> collection) Concatenate a collection to this list.booleanbooleanCheck whether this list contains the given element or not.booleanCheck whether this list contains the given element or not.booleanCheck whether this list contains the given element or not.booleanCheck whether this list contains any element that matches a given predicate or not.booleanCheck whether this list contains any element that matches a given predicate or not.booleanCheck whether this list contains any element that matches a given predicate or not.booleancontainsAll(Collection<?> c) intCopy the elements of this list to a buffer.intCopy the elements of this list to a buffer.intCopy the elements of this list to a buffer.intCopy the elements of this list to a buffer.intCopy the elements of this list to a buffer.intCopy the elements of this list to a buffer.intCopy the elements of this list to a buffer.static StringListcreate(StringList... list) Create a string list by concatenating one or more lists.static StringListCreate a string list from anIterable.static StringListCreate a string list.static StringListCreate a string list from an array of strings..static StringListcreate(Collection<String> collection) Create a string list from a collection.static StringListCreate a string list from anIterator.booleanget(int index) inthashCode()intintIndex of an element in the list.intIndex of an element in the list.intIndex of an element in the list.intReturns the index of the first occurrence of an element in the list that satisfies the given filter.intIndex of an element in the list that matches the given predicate.intIndex of an element in the list that matches the given predicate.intIndex of an element in the list that matches the given predicate.intReturns the index of the first element that matches the given predicate starting from the specified index.intIndex of an element in the list that matches the given predicate.booleanisEmpty()iterator()intlistIterator(int index) Create another instance by mapping the elements of this list via a converter function.minus(StringList another) Remove elements from this list that are elements of another list.remove(int index) booleanRemove an element from the list.booleanremoveAll(Collection<?> c) booleanretainAll(Collection<?> c) intsize()stream()Stream the elements.subList(int index) Get a sub-list.subList(int start, int end) Get a sub-list.Object[]toArray()<T> T[]toArray(T[] a) toString()Concatenate the elements of this list into aStringwith the given delimiter.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, removeIf, toArrayMethods inherited from interface java.util.List
addFirst, addLast, getFirst, getLast, removeFirst, removeLast, replaceAll, reversed, sort, spliterator
-
Field Details
-
EMPTY
-
-
Method Details
-
create
Create a string list.- Parameters:
list- Comma delimited list.- Returns:
- String list created.
-
create
Create a string list from a collection.- Parameters:
collection- Collection.- Returns:
- String list created.
-
create
Create a string list from anIterable.- Parameters:
list- Iterable.- Returns:
- String list created.
-
create
Create a string list from anIterator.- Parameters:
list- Iterator.- Returns:
- String list created.
-
create
Create a string list from an array of strings..- Parameters:
array- Array of strings.- Returns:
- String list created.
-
create
Create a string list by concatenating one or more lists.- Parameters:
list- Lists.- Returns:
- String list created.
-
map
Create another instance by mapping the elements of this list via a converter function.- Parameters:
converter- Converter function.- Returns:
- Converted list.
-
equals
-
hashCode
-
add
-
addAll
-
add
-
isEmpty
-
contains
-
toArray
-
toArray
-
remove
-
containsAll
- Specified by:
containsAllin interfaceCollection<String>- Specified by:
containsAllin interfaceList<String>
-
addAll
-
removeAll
-
retainAll
-
clear
-
set
-
remove
-
indexOf
-
lastIndexOf
- Specified by:
lastIndexOfin interfaceList<String>
-
listIterator
- Specified by:
listIteratorin interfaceList<String>
-
listIterator
- Specified by:
listIteratorin interfaceList<String>
-
get
-
size
-
array
Get a copy of the elements as an array.- Returns:
- Array containing elements of this list.
-
indexOf
Index of an element in the list.- Parameters:
element- Element.- Returns:
- Index position or -1 if not found.
-
indexOf
Index of an element in the list.- Parameters:
element- Element.from- Start the search from this position.- Returns:
- Index position or -1 if not found.
-
indexOf
Index of an element in the list.- Parameters:
element- Element.from- Start the search from this position.to- Stop the search before this position.- Returns:
- Index position or -1 if not found.
-
indexOf
Returns the index of the first occurrence of an element in the list that satisfies the given filter.- Parameters:
filter- the predicate used to test elements in the list- Returns:
- the index of the first matching element, or -1 if no element satisfies the filter
-
indexOf
Returns the index of the first element that matches the given predicate starting from the specified index.- Parameters:
filter- the predicate used to match elementsfrom- the index to start the search from (inclusive)- Returns:
- the index of the first matching element or -1 if no match is found
-
indexOf
-
indexOf
-
indexOf
Index of an element in the list that matches the given predicate.- Parameters:
filter- Filter predicate.unique- Whether uniqueness to be checked or not.from- Start the search from this position.- Returns:
- Index position or -1 if not found.
-
indexOf
Index of an element in the list that matches the given predicate.- Parameters:
filter- Filter predicate.unique- Whether uniqueness to be checked or not.from- Start the search from this position.to- Stop the search before this position.- Returns:
- Index position or -1 if not found.
-
contains
Check whether this list contains the given element or not.- Parameters:
element- Element.- Returns:
- True/false.
-
contains
Check whether this list contains the given element or not.- Parameters:
element- Element.from- Start the search from this position.- Returns:
- True/false.
-
contains
Check whether this list contains the given element or not.- Parameters:
element- Element.from- Start the search from this position.to- Stop the search before this position.- Returns:
- True/false.
-
contains
-
contains
-
contains
-
toString
-
toString
-
stream
Stream the elements.- Specified by:
streamin interfaceCollection<String>- Returns:
- Stream.
-
iterator
-
remove
Remove an element from the list.- Parameters:
element- Element to remove.- Returns:
- Modified list.
-
minus
Remove elements from this list that are elements of another list.- Parameters:
another- Another list.- Returns:
- Modified list.
-
subList
Get a sub-list.- Parameters:
index- Index from which sublist to be started.- Returns:
- Sub-list.
-
subList
Get a sub-list. -
concat
Concatenate another list to this list.- Parameters:
another- Another list.- Returns:
- Concatenated list.
-
concat
Concatenate another list to this list.- Parameters:
another- Another list.- Returns:
- Concatenated list.
-
concat
Concatenate a collection to this list.- Parameters:
collection- Collection.- Returns:
- Concatenated list.
-
concat
Concatenate 2 lists..- Parameters:
first- First list (could be null).second- Second list (could be null).- Returns:
- Concatenated list.
-
concat
Concatenate an array of lists.- Parameters:
lists- Array of lists.- Returns:
- Concatenated list.
-
concat
Concatenate an array of lists.- Parameters:
lists- Array of lists.- Returns:
- Concatenated list.
-
copyTo
Copy the elements of this list to a buffer.- Parameters:
buffer- Buffer to copy to- Returns:
- Number of elements copied. Zero will be returned if
bufferisnull.
-
copyTo
Copy the elements of this list to a buffer.- Parameters:
startingIndex- Starting index of the list from where copy beginsbuffer- Buffer to copy to- Returns:
- Number of elements copied. Zero will be returned if
bufferisnull.
-
copyTo
Copy the elements of this list to a buffer.- Parameters:
startingIndex- Starting index of the list from where copy beginscount- Number of elements to copybuffer- Buffer to copy to- Returns:
- Number of elements copied. Zero will be returned if
bufferisnull.
-
copyTo
Copy the elements of this list to a buffer.- Parameters:
buffer- Buffer to copy tostartingBufferIndex- Starting index of the buffer from where copy begins- Returns:
- Number of elements copied. Zero will be returned if
bufferisnull.
-
copyTo
Copy the elements of this list to a buffer.- Parameters:
buffer- Buffer to copy tostartingBufferIndex- Starting index of the buffer from where copy beginscount- Number of elements to copy- Returns:
- Number of elements copied. Zero will be returned if
bufferisnull.
-
copyTo
Copy the elements of this list to a buffer. Same ascopyTo(int, int, String[], int).- Parameters:
startingIndex- Starting index of the list from where copy beginsbuffer- Buffer to copy tostartingBufferIndex- Starting index of the buffer from where copy beginscount- Number of elements to copy- Returns:
- Number of elements copied. Zero will be returned if
bufferisnull.
-
copyTo
Copy the elements of this list to a buffer.- Parameters:
startingIndex- Starting index of the list from where copy beginscount- Number of elements to copybuffer- Buffer to copy tostartingBufferIndex- Starting index of the buffer from where copy begins- Returns:
- Number of elements copied. Zero will be returned if
bufferisnull.
-