Package com.storedobject.common
Class StringList
java.lang.Object
com.storedobject.common.StringList
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoid
boolean
boolean
addAll
(int index, Collection<? extends String> c) boolean
addAll
(Collection<? extends String> c) String[]
array()
Get a copy of the elements as an array.void
clear()
concat
(StringList another) Concatenate another list to this list.static StringList
concat
(StringList... lists) Concatenate an array of lists.static StringList
concat
(StringList first, StringList second) Concatenate 2 lists..Concatenate another list to this list.static StringList
Concatenate an array of lists.concat
(Collection<String> collection) Concatenate a collection to this list.boolean
boolean
Check whether this list contains the given element or not.boolean
Check whether this list contains the given element or not.boolean
Check whether this list contains the given element or not.boolean
Check whether this list contains any element that matches a given predicate or not.boolean
Check whether this list contains any element that matches a given predicate or not.boolean
Check whether this list contains any element that matches a given predicate or not.boolean
containsAll
(Collection<?> c) int
Copy the elements of this list to a buffer.int
Copy the elements of this list to a buffer.int
Copy the elements of this list to a buffer.int
Copy the elements of this list to a buffer.int
Copy the elements of this list to a buffer.int
Copy the elements of this list to a buffer.int
Copy the elements of this list to a buffer.static StringList
create
(StringList... list) Create a string list by concatenating one or more lists.static StringList
Create a string list from anIterable
.static StringList
Create a string list.static StringList
Create a string list from an array of strings..static StringList
create
(Collection<String> collection) Create a string list from a collection.static StringList
Create a string list from anIterator
.boolean
get
(int index) int
hashCode()
int
int
Index of an element in the list.int
Index of an element in the list.int
Index of an element in the list.int
Returns the index of the first occurrence of an element in the list that satisfies the given filter.int
Index of an element in the list that matches the given predicate.int
Index of an element in the list that matches the given predicate.int
Index of an element in the list that matches the given predicate.int
Returns the index of the first element that matches the given predicate starting from the specified index.int
Index of an element in the list that matches the given predicate.boolean
isEmpty()
iterator()
int
listIterator
(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) boolean
Remove an element from the list.boolean
removeAll
(Collection<?> c) boolean
retainAll
(Collection<?> c) int
size()
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 aString
with the given delimiter.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Collection
parallelStream, removeIf, toArray
Methods 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:
containsAll
in interfaceCollection<String>
- Specified by:
containsAll
in interfaceList<String>
-
addAll
-
removeAll
-
retainAll
-
clear
-
set
-
remove
-
indexOf
-
lastIndexOf
- Specified by:
lastIndexOf
in interfaceList<String>
-
listIterator
- Specified by:
listIterator
in interfaceList<String>
-
listIterator
- Specified by:
listIterator
in 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:
stream
in 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
buffer
isnull
.
-
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
buffer
isnull
.
-
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
buffer
isnull
.
-
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
buffer
isnull
.
-
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
buffer
isnull
.
-
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
buffer
isnull
.
-
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
buffer
isnull
.
-