ELEMENTTYPE
- List element typepublic class CommonsCopyOnWriteArrayList<ELEMENTTYPE> extends CopyOnWriteArrayList<ELEMENTTYPE> implements ICommonsList<ELEMENTTYPE>
CommonsCopyOnWriteArrayList
implementation based on
ICommonsList
.Constructor and Description |
---|
CommonsCopyOnWriteArrayList()
Create a new empty array list.
|
CommonsCopyOnWriteArrayList(Collection<? extends ELEMENTTYPE> aValues)
Create a new array list that contains the same elements as the provided
collection.
|
CommonsCopyOnWriteArrayList(ELEMENTTYPE... aValues)
Create a new array list that contains the same elements as the provided
array.
|
CommonsCopyOnWriteArrayList(ELEMENTTYPE aValue)
Create a new array list with an initial capacity of 1 and exactly the
provided value, even if it is
null . |
CommonsCopyOnWriteArrayList(Iterable<? extends ELEMENTTYPE> aValues)
Create a new array list with all provided elements.
|
CommonsCopyOnWriteArrayList(Iterable<? extends SRCTYPE> aValues,
Function<? super SRCTYPE,? extends ELEMENTTYPE> aMapper)
Create a new array list with all mapped items of the provided iterable.
|
CommonsCopyOnWriteArrayList(SRCTYPE[] aValues,
Function<? super SRCTYPE,? extends ELEMENTTYPE> aMapper)
Create a new array list that contains mapped elements of the provided
array.
|
Modifier and Type | Method and Description |
---|---|
static <ELEMENTTYPE> |
createFiltered(ELEMENTTYPE[] aValues,
Predicate<? super ELEMENTTYPE> aFilter)
Create a new array list that contains a subset of the provided array.
|
static <ELEMENTTYPE> |
createFiltered(Iterable<? extends ELEMENTTYPE> aValues,
Predicate<? super ELEMENTTYPE> aFilter)
Create a new array list that contains a subset of the provided
iterable.
|
static <SRCTYPE,ELEMENTTYPE> |
createFiltered(Iterable<? extends SRCTYPE> aValues,
Function<? super SRCTYPE,? extends ELEMENTTYPE> aMapper,
Predicate<? super ELEMENTTYPE> aFilter)
Create a new array list that contains a subset of the provided iterable.
|
static <SRCTYPE,ELEMENTTYPE> |
createFiltered(Iterable<? extends SRCTYPE> aValues,
Predicate<? super SRCTYPE> aFilter,
Function<? super SRCTYPE,? extends ELEMENTTYPE> aMapper)
Create a new array list that contains a subset of the provided iterable.
|
static <SRCTYPE,ELEMENTTYPE> |
createFiltered(SRCTYPE[] aValues,
Function<? super SRCTYPE,? extends ELEMENTTYPE> aMapper,
Predicate<? super ELEMENTTYPE> aFilter)
Create a new array list that contains a subset of the provided array.
|
static <SRCTYPE,ELEMENTTYPE> |
createFiltered(SRCTYPE[] aValues,
Predicate<? super SRCTYPE> aFilter,
Function<? super SRCTYPE,? extends ELEMENTTYPE> aMapper)
Create a new array list that contains a subset of the provided array.
|
<T> CommonsCopyOnWriteArrayList<T> |
createInstance()
Create a new empty list.
|
CommonsCopyOnWriteArrayList<ELEMENTTYPE> |
getClone() |
add, add, addAll, addAll, addAllAbsent, addIfAbsent, clear, clone, contains, containsAll, equals, forEach, get, hashCode, indexOf, indexOf, isEmpty, iterator, lastIndexOf, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, toString
finalize, getClass, notify, notifyAll, wait, wait, wait
getAll, getAllInstanceOf, getAllMapped, getAllMapped, getAsUnmodifiable, getAtIndex, getFirst, getFirst, getLast, getLast, getSortedInline, removeAndReturnElementAtIndex, removeAtIndex, removeFirst, removeLast, reverse, setFirst, setLast, swapItems
add, add, addAll, addAll, clear, contains, containsAll, equals, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray
addAll, addAll, addAll, addAll, addAll, addAll, addAll, addAll, addAllMapped, addAllMapped, addAllMapped, addAllMapped, addAllMapped, addAllMapped, addIf, addIfNotNull, addObject, getAtIndex, getAtIndex, getAtIndex, getAtIndexMapped, getAtIndexMapped, getAtIndexMapped, getAtIndexMapped, getCopyAsList, getCount, getSorted, iterator2, removeAll, removeObject, set, setAll, setAll, setAllMapped, setAllMapped
parallelStream, removeIf, stream
containsAny, containsNone, containsOnly, findAll, findAllInstanceOf, findAllMapped, findAllMapped, findAllMapped, findFirst, findFirst, findFirstIndex, findFirstMapped, findFirstMapped, findLastIndex, forEach, forEachBreakable, forEachByIndex, getCount
isEmpty, isNotEmpty, size
public CommonsCopyOnWriteArrayList()
public CommonsCopyOnWriteArrayList(@Nullable Collection<? extends ELEMENTTYPE> aValues)
aValues
- The collection to copy the elements from. May be null
.CopyOnWriteArrayList.addAll(Collection)
public CommonsCopyOnWriteArrayList(@Nullable Iterable<? extends ELEMENTTYPE> aValues)
aValues
- The iterable from which the elements are copied from. May be
null
.ICommonsCollection.addAll(Iterable)
public CommonsCopyOnWriteArrayList(@Nullable Iterable<? extends SRCTYPE> aValues, @Nonnull Function<? super SRCTYPE,? extends ELEMENTTYPE> aMapper)
SRCTYPE
- source data typeaValues
- The iterable from which the elements are copied from. May be
null
.aMapper
- The mapping function to be executed for all provided elements. May
not be null
.ICommonsCollection.addAllMapped(Iterable, Function)
public CommonsCopyOnWriteArrayList(@Nullable ELEMENTTYPE aValue)
null
.aValue
- The value to be added. May be null
.@SafeVarargs public CommonsCopyOnWriteArrayList(@Nullable ELEMENTTYPE... aValues)
aValues
- The array to copy the elements from. May be null
.ICommonsCollection.addAll(Object...)
public CommonsCopyOnWriteArrayList(@Nullable SRCTYPE[] aValues, @Nonnull Function<? super SRCTYPE,? extends ELEMENTTYPE> aMapper)
SRCTYPE
- source data typeaValues
- The array to copy the elements from. May be null
.aMapper
- The mapping function to be executed for all provided elements. May
not be null
.ICommonsCollection.addAllMapped(Object[], Function)
@Nonnull @ReturnsMutableCopy public <T> CommonsCopyOnWriteArrayList<T> createInstance()
ICommonsList
CommonsArrayList
.createInstance
in interface ICommonsList<ELEMENTTYPE>
T
- List element typenull
.@Nonnull @ReturnsMutableCopy public CommonsCopyOnWriteArrayList<ELEMENTTYPE> getClone()
getClone
in interface ICloneable<ICommonsList<ELEMENTTYPE>>
@Nonnull @ReturnsMutableCopy public static <ELEMENTTYPE> CommonsCopyOnWriteArrayList<ELEMENTTYPE> createFiltered(@Nullable Iterable<? extends ELEMENTTYPE> aValues, @Nullable Predicate<? super ELEMENTTYPE> aFilter)
Predicate
and Function
and the
mapping case occurs more often.ELEMENTTYPE
- data type of the listaValues
- The iterable from which the elements are copied from. May be
null
.aFilter
- The filter to be applied to check if the element should be added or
not.null
.ICommonsCollection.addAll(Iterable, Predicate)
@Nonnull @ReturnsMutableCopy public static <SRCTYPE,ELEMENTTYPE> CommonsCopyOnWriteArrayList<ELEMENTTYPE> createFiltered(@Nullable Iterable<? extends SRCTYPE> aValues, @Nullable Predicate<? super SRCTYPE> aFilter, @Nonnull Function<? super SRCTYPE,? extends ELEMENTTYPE> aMapper)
Predicate
and Function
and the
mapping case occurs more often.SRCTYPE
- source data typeELEMENTTYPE
- final data type of the listaValues
- The iterable from which the elements are copied from. May be
null
.aFilter
- The filter to be applied to check if the element should be added or
not.aMapper
- The mapping function to be executed for all provided elements. May
not be null
.null
.ICommonsCollection.addAllMapped(Iterable, Predicate, Function)
@Nonnull @ReturnsMutableCopy public static <SRCTYPE,ELEMENTTYPE> CommonsCopyOnWriteArrayList<ELEMENTTYPE> createFiltered(@Nullable Iterable<? extends SRCTYPE> aValues, @Nonnull Function<? super SRCTYPE,? extends ELEMENTTYPE> aMapper, @Nullable Predicate<? super ELEMENTTYPE> aFilter)
Predicate
and Function
and the
mapping case occurs more often.SRCTYPE
- source data typeELEMENTTYPE
- final data type of the listaValues
- The iterable from which the elements are copied from. May be
null
.aMapper
- The mapping function to be executed for all provided elements. May
not be null
.aFilter
- The filter to be applied on the mapped element to check if the
element should be added or not.null
.ICommonsCollection.addAllMapped(Iterable, Function, Predicate)
@Nonnull @ReturnsMutableCopy public static <ELEMENTTYPE> CommonsCopyOnWriteArrayList<ELEMENTTYPE> createFiltered(@Nullable ELEMENTTYPE[] aValues, @Nullable Predicate<? super ELEMENTTYPE> aFilter)
Predicate
and Function
and the
mapping case occurs more often.ELEMENTTYPE
- data type of the listaValues
- The array from which the elements are copied from. May be
null
.aFilter
- The filter to be applied to check if the element should be added or
not.null
.ICommonsCollection.addAll(Object[], Predicate)
@Nonnull @ReturnsMutableCopy public static <SRCTYPE,ELEMENTTYPE> CommonsCopyOnWriteArrayList<ELEMENTTYPE> createFiltered(@Nullable SRCTYPE[] aValues, @Nullable Predicate<? super SRCTYPE> aFilter, @Nonnull Function<? super SRCTYPE,? extends ELEMENTTYPE> aMapper)
Predicate
and Function
and the
mapping case occurs more often.SRCTYPE
- source data typeELEMENTTYPE
- final data type of the listaValues
- The array from which the elements are copied from. May be
null
.aFilter
- The filter to be applied to check if the element should be added or
not.aMapper
- The mapping function to be executed for all provided elements. May
not be null
.null
.ICommonsCollection.addAllMapped(Object[], Predicate, Function)
@Nonnull @ReturnsMutableCopy public static <SRCTYPE,ELEMENTTYPE> CommonsCopyOnWriteArrayList<ELEMENTTYPE> createFiltered(@Nullable SRCTYPE[] aValues, @Nonnull Function<? super SRCTYPE,? extends ELEMENTTYPE> aMapper, @Nullable Predicate<? super ELEMENTTYPE> aFilter)
Predicate
and Function
and the
mapping case occurs more often.SRCTYPE
- source data typeELEMENTTYPE
- final data type of the listaValues
- The array from which the elements are copied from. May be
null
.aMapper
- The mapping function to be executed for all provided elements. May
not be null
.aFilter
- The filter to be applied on the mapped element to check if the
element should be added or not.null
.ICommonsCollection.addAllMapped(Iterable, Function, Predicate)
Copyright © 2014–2019 Philip Helger. All rights reserved.