Class ArrayListAdapter<T>
java.lang.Object
org.eclipse.collections.impl.collection.mutable.AbstractCollectionAdapter<T>
org.eclipse.collections.impl.list.mutable.AbstractListAdapter<T>
org.eclipse.collections.impl.list.mutable.ArrayListAdapter<T>
- All Implemented Interfaces:
Serializable,Cloneable,Iterable<T>,Collection<T>,List<T>,RandomAccess,MutableCollection<T>,InternalIterable<T>,ListIterable<T>,MutableList<T>,OrderedIterable<T>,ReversibleIterable<T>,RichIterable<T>
public final class ArrayListAdapter<T>
extends AbstractListAdapter<T>
implements RandomAccess, Serializable
This class provides a MutableList wrapper around a JDK Collections ArrayList instance. All the MutableList
interface methods are supported in addition to the JDK ArrayList methods.
To create a new wrapper around an existing ArrayList instance, use the adapt(ArrayList) factory method. To
create a new empty wrapper, use the newList() or newList(int) factory methods.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic <E> ArrayListAdapter<E>booleanallSatisfy(Predicate<? super T> predicate) booleananySatisfy(Predicate<? super T> predicate) clone()<V> ArrayListAdapter<V><V> ArrayListAdapter<V><P,A> ArrayListAdapter<A> collectWith(Function2<? super T, ? super P, ? extends A> function, P parameter) <S> booleancorresponds(OrderedIterable<S> other, Predicate2<? super T, ? super S> predicate) intdetectIfNone(Predicate<? super T> predicate, Function0<? extends T> function) intdetectIndex(Predicate<? super T> predicate) intdetectLastIndex(Predicate<? super T> predicate) distinct()distinct(HashingStrategy<? super T> hashingStrategy) <V> ArrayListAdapter<T>distinctBy(Function<? super T, ? extends V> function) drop(int count) void<V> ArrayListAdapter<V>flatCollect(Function<? super T, ? extends Iterable<V>> function) voidvoidforEachWithIndex(int fromIndex, int toIndex, ObjectIntProcedure<? super T> objectIntProcedure) voidforEachWithIndex(ObjectIntProcedure<? super T> objectIntProcedure) <V> FastListMultimap<V,T> <V> FastListMultimap<V,T> groupByEach(Function<? super T, ? extends Iterable<V>> function) <IV> IVinjectInto(IV injectedValue, Function2<? super IV, ? super T, ? extends IV> function) newEmpty()static <E> ArrayListAdapter<E>newList()static <E> ArrayListAdapter<E>newList(int size) booleannoneSatisfy(Predicate<? super T> predicate) partitionWhile(Predicate<? super T> predicate) <P> PartitionMutableList<T>partitionWith(Predicate2<? super T, ? super P> predicate, P parameter) <P> ArrayListAdapter<T>rejectWith(Predicate2<? super T, ? super P> predicate, P parameter) voidreverseForEach(Procedure<? super T> procedure) voidreverseForEachWithIndex(ObjectIntProcedure<? super T> procedure) <S> MutableList<S>selectInstancesOf(Class<S> clazz) <P> ArrayListAdapter<T>selectWith(Predicate2<? super T, ? super P> predicate, P parameter) voidsort(Comparator<? super T> comparator) sortThis()sortThis(Comparator<? super T> comparator) take(int count) withoutAll(Iterable<? extends T> elements) <S> MutableList<Pair<T,S>> Methods inherited from class org.eclipse.collections.impl.list.mutable.AbstractListAdapter
add, addAll, asParallel, asReversed, equals, get, hashCode, indexOf, lastIndexOf, listIterator, listIterator, remove, set, sortThisByBoolean, sortThisByByte, sortThisByChar, sortThisByDouble, sortThisByFloat, sortThisByInt, sortThisByLong, sortThisByShort, subList, tap, toStackMethods inherited from class org.eclipse.collections.impl.collection.mutable.AbstractCollectionAdapter
add, addAll, addAllIterable, allSatisfyWith, anySatisfyWith, appendString, asLazy, chunk, clear, collect, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectIf, collectInt, collectLong, collectShort, collectWith, contains, containsAll, containsAllArguments, containsAllIterable, countWith, detectOptional, detectWith, detectWithIfNone, detectWithOptional, flatCollect, forEachWith, getFirst, getLast, getOnly, groupBy, groupByEach, groupByUniqueKey, groupByUniqueKey, injectInto, injectInto, injectInto, injectInto, injectIntoWith, into, isEmpty, iterator, max, max, maxBy, min, min, minBy, noneSatisfyWith, notEmpty, reject, rejectWith, remove, removeAll, removeAllIterable, removeIf, removeIfWith, retainAll, retainAllIterable, select, selectAndRejectWith, selectWith, size, sumByDouble, sumByFloat, sumByInt, sumByLong, sumOfDouble, sumOfFloat, sumOfInt, sumOfLong, toArray, toArray, toBag, toBiMap, toList, toMap, toMap, toSet, toSortedBag, toSortedBag, toSortedList, toSortedMap, toSortedMap, toSortedSet, toSortedSet, toString, zip, zipWithIndexMethods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArrayMethods inherited from interface org.eclipse.collections.api.InternalIterable
forEach, forEachWithMethods inherited from interface java.util.List
add, addAll, clear, contains, containsAll, isEmpty, iterator, remove, removeAll, replaceAll, retainAll, size, spliteratorMethods inherited from interface org.eclipse.collections.api.list.ListIterable
binarySearch, binarySearch, forEachInBothMethods inherited from interface org.eclipse.collections.api.collection.MutableCollection
addAllIterable, aggregateBy, aggregateInPlaceBy, countBy, countByEach, countByWith, groupByUniqueKey, injectIntoWith, removeAllIterable, removeIf, removeIfWith, retainAllIterable, selectAndRejectWith, sumByDouble, sumByFloat, sumByInt, sumByLongMethods inherited from interface org.eclipse.collections.api.list.MutableList
collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectInt, collectLong, collectShort, collectWithIndex, flatCollectWith, getFirst, getLast, rejectWithIndex, reverseThis, selectWithIndex, shuffleThis, shuffleThis, sortThisBy, toArray, toArray, toImmutable, toImmutableList, toReversedMethods inherited from interface org.eclipse.collections.api.ordered.OrderedIterable
collectWithIndex, getFirstOptional, getLastOptional, max, min, rejectWithIndex, selectWithIndex, zip, zipWithIndexMethods inherited from interface org.eclipse.collections.api.RichIterable
aggregateBy, allSatisfyWith, anySatisfyWith, appendString, appendString, appendString, asLazy, chunk, collect, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectIf, collectInt, collectLong, collectShort, collectWith, contains, containsAll, containsAllArguments, containsAllIterable, containsAny, containsAnyIterable, containsBy, containsNone, containsNoneIterable, countBy, countByEach, countByWith, countWith, detectOptional, detectWith, detectWithIfNone, detectWithOptional, flatCollect, flatCollectBoolean, flatCollectByte, flatCollectChar, flatCollectDouble, flatCollectFloat, flatCollectInt, flatCollectLong, flatCollectShort, flatCollectWith, forEach, getAny, getOnly, groupBy, groupByAndCollect, groupByEach, groupByUniqueKey, injectInto, injectInto, injectInto, injectInto, injectIntoDouble, injectIntoFloat, injectIntoInt, injectIntoLong, into, isEmpty, makeString, makeString, makeString, makeString, max, maxBy, maxByOptional, maxOptional, maxOptional, min, minBy, minByOptional, minOptional, minOptional, noneSatisfyWith, notEmpty, reduce, reduceBy, reduceBy, reduceInPlace, reduceInPlace, reject, rejectWith, select, selectWith, size, summarizeDouble, summarizeFloat, summarizeInt, summarizeLong, sumOfDouble, sumOfFloat, sumOfInt, sumOfLong, toBag, toBiMap, toImmutableBag, toImmutableBiMap, toImmutableMap, toImmutableSet, toImmutableSortedBag, toImmutableSortedBag, toImmutableSortedBagBy, toImmutableSortedList, toImmutableSortedList, toImmutableSortedListBy, toImmutableSortedSet, toImmutableSortedSet, toImmutableSortedSetBy, toList, toMap, toMap, toSet, toSortedBag, toSortedBag, toSortedBagBy, toSortedList, toSortedList, toSortedListBy, toSortedMap, toSortedMap, toSortedMapBy, toSortedSet, toSortedSet, toSortedSetBy, toString
-
Method Details
-
newList
-
newList
-
adapt
-
asUnmodifiable
- Specified by:
asUnmodifiablein interfaceMutableCollection<T>- Specified by:
asUnmodifiablein interfaceMutableList<T>
-
asSynchronized
- Specified by:
asSynchronizedin interfaceMutableCollection<T>- Specified by:
asSynchronizedin interfaceMutableList<T>
-
clone
- Specified by:
clonein interfaceMutableList<T>- Overrides:
clonein classAbstractListAdapter<T>
-
newEmpty
- Specified by:
newEmptyin interfaceMutableCollection<T>- Specified by:
newEmptyin interfaceMutableList<T>
-
each
- Specified by:
eachin interfaceRichIterable<T>- Overrides:
eachin classAbstractCollectionAdapter<T>
-
reverseForEach
- Specified by:
reverseForEachin interfaceReversibleIterable<T>
-
reverseForEachWithIndex
- Specified by:
reverseForEachWithIndexin interfaceReversibleIterable<T>
-
forEachWithIndex
- Specified by:
forEachWithIndexin interfaceInternalIterable<T>- Specified by:
forEachWithIndexin interfaceOrderedIterable<T>- Overrides:
forEachWithIndexin classAbstractCollectionAdapter<T>
-
forEachWithIndex
public void forEachWithIndex(int fromIndex, int toIndex, ObjectIntProcedure<? super T> objectIntProcedure) - Specified by:
forEachWithIndexin interfaceOrderedIterable<T>
-
detect
- Specified by:
detectin interfaceRichIterable<T>- Overrides:
detectin classAbstractCollectionAdapter<T>
-
detectIfNone
- Specified by:
detectIfNonein interfaceRichIterable<T>- Overrides:
detectIfNonein classAbstractCollectionAdapter<T>
-
count
- Specified by:
countin interfaceRichIterable<T>- Overrides:
countin classAbstractCollectionAdapter<T>
-
corresponds
- Specified by:
correspondsin interfaceOrderedIterable<T>
-
anySatisfy
- Specified by:
anySatisfyin interfaceRichIterable<T>- Overrides:
anySatisfyin classAbstractCollectionAdapter<T>
-
allSatisfy
- Specified by:
allSatisfyin interfaceRichIterable<T>- Overrides:
allSatisfyin classAbstractCollectionAdapter<T>
-
noneSatisfy
- Specified by:
noneSatisfyin interfaceRichIterable<T>- Overrides:
noneSatisfyin classAbstractCollectionAdapter<T>
-
injectInto
- Specified by:
injectIntoin interfaceRichIterable<T>- Overrides:
injectIntoin classAbstractCollectionAdapter<T>
-
forEach
- Specified by:
forEachin interfaceOrderedIterable<T>
-
sort
-
sortThis
- Specified by:
sortThisin interfaceMutableList<T>- Since:
- 10.0 - Override for backwards compatibility
-
sortThis
- Specified by:
sortThisin interfaceMutableList<T>- Since:
- 10.0 - Override for backwards compatibility
-
with
- Specified by:
within interfaceMutableCollection<T>- Specified by:
within interfaceMutableList<T>
-
with
-
with
-
with
-
without
- Specified by:
withoutin interfaceMutableCollection<T>- Specified by:
withoutin interfaceMutableList<T>
-
withAll
- Specified by:
withAllin interfaceMutableCollection<T>- Specified by:
withAllin interfaceMutableList<T>
-
withoutAll
- Specified by:
withoutAllin interfaceMutableCollection<T>- Specified by:
withoutAllin interfaceMutableList<T>
-
select
- Specified by:
selectin interfaceListIterable<T>- Specified by:
selectin interfaceMutableCollection<T>- Specified by:
selectin interfaceMutableList<T>- Specified by:
selectin interfaceOrderedIterable<T>- Specified by:
selectin interfaceReversibleIterable<T>- Specified by:
selectin interfaceRichIterable<T>- Overrides:
selectin classAbstractListAdapter<T>
-
reject
- Specified by:
rejectin interfaceListIterable<T>- Specified by:
rejectin interfaceMutableCollection<T>- Specified by:
rejectin interfaceMutableList<T>- Specified by:
rejectin interfaceOrderedIterable<T>- Specified by:
rejectin interfaceReversibleIterable<T>- Specified by:
rejectin interfaceRichIterable<T>- Overrides:
rejectin classAbstractListAdapter<T>
-
partition
- Specified by:
partitionin interfaceListIterable<T>- Specified by:
partitionin interfaceMutableCollection<T>- Specified by:
partitionin interfaceMutableList<T>- Specified by:
partitionin interfaceOrderedIterable<T>- Specified by:
partitionin interfaceReversibleIterable<T>- Specified by:
partitionin interfaceRichIterable<T>- Overrides:
partitionin classAbstractListAdapter<T>
-
partitionWith
public <P> PartitionMutableList<T> partitionWith(Predicate2<? super T, ? super P> predicate, P parameter) - Specified by:
partitionWithin interfaceListIterable<T>- Specified by:
partitionWithin interfaceMutableCollection<T>- Specified by:
partitionWithin interfaceMutableList<T>- Specified by:
partitionWithin interfaceOrderedIterable<T>- Specified by:
partitionWithin interfaceReversibleIterable<T>- Specified by:
partitionWithin interfaceRichIterable<T>- Overrides:
partitionWithin classAbstractListAdapter<T>
-
selectInstancesOf
- Specified by:
selectInstancesOfin interfaceListIterable<T>- Specified by:
selectInstancesOfin interfaceMutableCollection<T>- Specified by:
selectInstancesOfin interfaceMutableList<T>- Specified by:
selectInstancesOfin interfaceOrderedIterable<T>- Specified by:
selectInstancesOfin interfaceReversibleIterable<T>- Specified by:
selectInstancesOfin interfaceRichIterable<T>- Overrides:
selectInstancesOfin classAbstractListAdapter<T>
-
collect
- Specified by:
collectin interfaceListIterable<T>- Specified by:
collectin interfaceMutableCollection<T>- Specified by:
collectin interfaceMutableList<T>- Specified by:
collectin interfaceOrderedIterable<T>- Specified by:
collectin interfaceReversibleIterable<T>- Specified by:
collectin interfaceRichIterable<T>- Overrides:
collectin classAbstractListAdapter<T>
-
flatCollect
- Specified by:
flatCollectin interfaceListIterable<T>- Specified by:
flatCollectin interfaceMutableCollection<T>- Specified by:
flatCollectin interfaceMutableList<T>- Specified by:
flatCollectin interfaceOrderedIterable<T>- Specified by:
flatCollectin interfaceReversibleIterable<T>- Specified by:
flatCollectin interfaceRichIterable<T>- Overrides:
flatCollectin classAbstractListAdapter<T>
-
collectIf
public <V> ArrayListAdapter<V> collectIf(Predicate<? super T> predicate, Function<? super T, ? extends V> function) - Specified by:
collectIfin interfaceListIterable<T>- Specified by:
collectIfin interfaceMutableCollection<T>- Specified by:
collectIfin interfaceMutableList<T>- Specified by:
collectIfin interfaceOrderedIterable<T>- Specified by:
collectIfin interfaceReversibleIterable<T>- Specified by:
collectIfin interfaceRichIterable<T>- Overrides:
collectIfin classAbstractListAdapter<T>
-
detectIndex
- Specified by:
detectIndexin interfaceOrderedIterable<T>
-
detectLastIndex
- Specified by:
detectLastIndexin interfaceReversibleIterable<T>
-
groupBy
- Specified by:
groupByin interfaceListIterable<T>- Specified by:
groupByin interfaceMutableCollection<T>- Specified by:
groupByin interfaceMutableList<T>- Specified by:
groupByin interfaceOrderedIterable<T>- Specified by:
groupByin interfaceReversibleIterable<T>- Specified by:
groupByin interfaceRichIterable<T>- Overrides:
groupByin classAbstractListAdapter<T>
-
groupByEach
- Specified by:
groupByEachin interfaceListIterable<T>- Specified by:
groupByEachin interfaceMutableCollection<T>- Specified by:
groupByEachin interfaceMutableList<T>- Specified by:
groupByEachin interfaceOrderedIterable<T>- Specified by:
groupByEachin interfaceReversibleIterable<T>- Specified by:
groupByEachin interfaceRichIterable<T>- Overrides:
groupByEachin classAbstractListAdapter<T>
-
selectWith
- Specified by:
selectWithin interfaceListIterable<T>- Specified by:
selectWithin interfaceMutableCollection<T>- Specified by:
selectWithin interfaceMutableList<T>- Specified by:
selectWithin interfaceOrderedIterable<T>- Specified by:
selectWithin interfaceReversibleIterable<T>- Specified by:
selectWithin interfaceRichIterable<T>- Overrides:
selectWithin classAbstractListAdapter<T>
-
rejectWith
- Specified by:
rejectWithin interfaceListIterable<T>- Specified by:
rejectWithin interfaceMutableCollection<T>- Specified by:
rejectWithin interfaceMutableList<T>- Specified by:
rejectWithin interfaceOrderedIterable<T>- Specified by:
rejectWithin interfaceReversibleIterable<T>- Specified by:
rejectWithin interfaceRichIterable<T>- Overrides:
rejectWithin classAbstractListAdapter<T>
-
collectWith
public <P,A> ArrayListAdapter<A> collectWith(Function2<? super T, ? super P, ? extends A> function, P parameter) - Specified by:
collectWithin interfaceListIterable<T>- Specified by:
collectWithin interfaceMutableCollection<T>- Specified by:
collectWithin interfaceMutableList<T>- Specified by:
collectWithin interfaceOrderedIterable<T>- Specified by:
collectWithin interfaceReversibleIterable<T>- Specified by:
collectWithin interfaceRichIterable<T>- Overrides:
collectWithin classAbstractListAdapter<T>
-
distinct
- Specified by:
distinctin interfaceListIterable<T>- Specified by:
distinctin interfaceMutableList<T>- Specified by:
distinctin interfaceOrderedIterable<T>- Specified by:
distinctin interfaceReversibleIterable<T>
-
distinct
- Specified by:
distinctin interfaceListIterable<T>- Specified by:
distinctin interfaceMutableList<T>
-
distinctBy
- Specified by:
distinctByin interfaceListIterable<T>- Specified by:
distinctByin interfaceMutableList<T>- Overrides:
distinctByin classAbstractListAdapter<T>- Since:
- 9.0
-
zip
- Specified by:
zipin interfaceListIterable<T>- Specified by:
zipin interfaceMutableCollection<T>- Specified by:
zipin interfaceMutableList<T>- Specified by:
zipin interfaceOrderedIterable<T>- Specified by:
zipin interfaceReversibleIterable<T>- Specified by:
zipin interfaceRichIterable<T>- Overrides:
zipin classAbstractListAdapter<T>
-
zipWithIndex
- Specified by:
zipWithIndexin interfaceListIterable<T>- Specified by:
zipWithIndexin interfaceMutableCollection<T>- Specified by:
zipWithIndexin interfaceMutableList<T>- Specified by:
zipWithIndexin interfaceOrderedIterable<T>- Specified by:
zipWithIndexin interfaceReversibleIterable<T>- Specified by:
zipWithIndexin interfaceRichIterable<T>- Overrides:
zipWithIndexin classAbstractListAdapter<T>
-
take
- Specified by:
takein interfaceListIterable<T>- Specified by:
takein interfaceMutableList<T>- Specified by:
takein interfaceReversibleIterable<T>
-
takeWhile
- Specified by:
takeWhilein interfaceListIterable<T>- Specified by:
takeWhilein interfaceMutableList<T>- Specified by:
takeWhilein interfaceOrderedIterable<T>- Specified by:
takeWhilein interfaceReversibleIterable<T>
-
drop
- Specified by:
dropin interfaceListIterable<T>- Specified by:
dropin interfaceMutableList<T>- Specified by:
dropin interfaceReversibleIterable<T>
-
dropWhile
- Specified by:
dropWhilein interfaceListIterable<T>- Specified by:
dropWhilein interfaceMutableList<T>- Specified by:
dropWhilein interfaceOrderedIterable<T>- Specified by:
dropWhilein interfaceReversibleIterable<T>
-
partitionWhile
- Specified by:
partitionWhilein interfaceListIterable<T>- Specified by:
partitionWhilein interfaceMutableList<T>- Specified by:
partitionWhilein interfaceOrderedIterable<T>- Specified by:
partitionWhilein interfaceReversibleIterable<T>
-