Top Fields Constructors Methods
org.eclipse.collections.impl.list.fixed

public abstract Class AbstractArrayAdapter<T>

extends AbstractMutableList<T>
implements RandomAccess
Class Inheritance
All Implemented Interfaces
java.util.RandomAccess
Known Direct Subclasses
org.eclipse.collections.impl.list.fixed.ArrayAdapter
Imports
java.lang.reflect.Array, java.util.Arrays, .Collection, .Comparator, .Iterator, .List, .ListIterator, .Optional, .RandomAccess, java.util.function.UnaryOperator, org.eclipse.collections.api.block.HashingStrategy, org.eclipse.collections.api.block.function.Function, .Function2, .Function3, org.eclipse.collections.api.block.predicate.Predicate, .Predicate2, org.eclipse.collections.api.block.procedure.Procedure, .Procedure2, org.eclipse.collections.api.block.procedure.primitive.ObjectIntProcedure, org.eclipse.collections.api.factory.Lists, org.eclipse.collections.api.list.MutableList, org.eclipse.collections.api.ordered.OrderedIterable, org.eclipse.collections.api.tuple.Twin, org.eclipse.collections.impl.block.factory.Predicates2, org.eclipse.collections.impl.list.mutable.AbstractMutableList, .FastList, .ListAdapter, org.eclipse.collections.impl.utility.ArrayIterate, .ListIterate, org.eclipse.collections.impl.utility.internal.InternalArrayIterate, .RandomAccessListIterate

Field Summary

Modifier and TypeField and Description
protected T[]
private static final Object[]

Constructor Summary

AccessConstructor and Description
protected
AbstractArrayAdapter()

This method must be here so subclasses can be serializable.

protected
AbstractArrayAdapter(T[] newElements)

Method Summary

Modifier and TypeMethod and Description
public boolean
public void
add(int index, T element)

Implements java.util.List.add.

Inserts the specified element at the specified position in this list (optional operation).

public boolean
addAll(Collection<? extends T> collection)

Overrides org.eclipse.collections.impl.collection.mutable.AbstractMutableCollection.addAll.

Implements java.util.Collection.addAll, java.util.List.addAll.

Appends all of the elements in the specified collection to the end of this list, in the order that they are returned by the specified collection's iterator (optional operation).

public boolean
addAll(int index, Collection<? extends T> collection)

Implements java.util.List.addAll.

Inserts all of the elements in the specified collection into this list at the specified position (optional operation).

public boolean
public boolean
allSatisfy(Predicate<? super T> predicate)

Overrides org.eclipse.collections.impl.list.mutable.AbstractMutableList.allSatisfy.

Implements org.eclipse.collections.api.RichIterable.allSatisfy.

Returns true if the predicate evaluates to true for every element of the iterable or if the iterable is empty.

public <P> boolean
allSatisfyWith(Predicate2<? super T, ? super P> predicate, P parameter)

Overrides org.eclipse.collections.impl.list.mutable.AbstractMutableList.allSatisfyWith.

Implements org.eclipse.collections.api.RichIterable.allSatisfyWith.

Returns true if the predicate evaluates to true for every element of the collection, or returns false.

public boolean
anySatisfy(Predicate<? super T> predicate)

Overrides org.eclipse.collections.impl.list.mutable.AbstractMutableList.anySatisfy.

Implements org.eclipse.collections.api.RichIterable.anySatisfy.

Returns true if the predicate evaluates to true for any element of the iterable.

public <P> boolean
anySatisfyWith(Predicate2<? super T, ? super P> predicate, P parameter)

Overrides org.eclipse.collections.impl.list.mutable.AbstractMutableList.anySatisfyWith.

Implements org.eclipse.collections.api.RichIterable.anySatisfyWith.

Returns true if the predicate evaluates to true for any element of the collection, or return false.

public void
appendString(Appendable appendable, String start, String separator, String end)

Overrides org.eclipse.collections.impl.list.mutable.AbstractMutableList.appendString.

Implements org.eclipse.collections.api.RichIterable.appendString.

Prints a string representation of this collection onto the given Appendable.

public void
clear()

Overrides org.eclipse.collections.impl.list.mutable.AbstractMutableList.clear.

Implements java.util.Collection.clear, java.util.List.clear.

Removes all of the elements from this list (optional operation).

public <V> MutableList<V>
collect(Function<? super T, ? extends V> function)

Overrides default org.eclipse.collections.api.list.MutableList.collect.

Implements org.eclipse.collections.api.collection.MutableCollection.collect, org.eclipse.collections.api.RichIterable.collect.

Returns a new MutableCollection with the results of applying the specified function to each element of the source collection.

public <V, R extends Collection<V>> R
collect(Function<? super T, ? extends V> function, R target)

Overrides org.eclipse.collections.impl.list.mutable.AbstractMutableList.collect.

Implements org.eclipse.collections.api.RichIterable.collect.

Same as collect(Function), except that the results are gathered into the specified target collection.

public <V, R extends Collection<V>> R
collectIf(Predicate<? super T> predicate, Function<? super T, ? extends V> function, R target)

Overrides org.eclipse.collections.impl.list.mutable.AbstractMutableList.collectIf.

Implements org.eclipse.collections.api.RichIterable.collectIf.

Same as the collectIf method with two parameters but uses the specified target collection for the results.

public <P, A> MutableList<A>
collectWith(Function2<? super T, ? super P, ? extends A> function, P parameter)

Overrides default org.eclipse.collections.api.list.MutableList.collectWith.

Implements org.eclipse.collections.api.collection.MutableCollection.collectWith, org.eclipse.collections.api.RichIterable.collectWith.

Same as collect(Function) with a Function2 and specified parameter which is passed to the block.

public <P, A, R extends Collection<A>> R
collectWith(Function2<? super T, ? super P, ? extends A> function, P parameter, R target)

Overrides org.eclipse.collections.impl.list.mutable.AbstractMutableList.collectWith.

Implements org.eclipse.collections.api.RichIterable.collectWith.

Same as collectWith but with a targetCollection parameter to gather the results.

public boolean
public <S> boolean
corresponds(OrderedIterable<S> other, Predicate2<? super T, ? super S> predicate)

Overrides org.eclipse.collections.impl.list.mutable.AbstractMutableList.corresponds.

Implements org.eclipse.collections.api.ordered.OrderedIterable.corresponds.

Returns true if both OrderedIterables have the same length and predicate returns true for all corresponding elements e1 of this OrderedIterable and e2 of other.

public int
count(Predicate<? super T> predicate)

Overrides org.eclipse.collections.impl.list.mutable.AbstractMutableList.count.

Implements org.eclipse.collections.api.RichIterable.count.

Return the total number of elements that answer true to the specified predicate.

public <P> int
countWith(Predicate2<? super T, ? super P> predicate, P parameter)

Overrides org.eclipse.collections.impl.list.mutable.AbstractMutableList.countWith.

Implements org.eclipse.collections.api.RichIterable.countWith.

Returns the total number of elements that evaluate to true for the specified predicate.

public T
detect(Predicate<? super T> predicate)

Overrides org.eclipse.collections.impl.list.mutable.AbstractMutableList.detect.

Implements org.eclipse.collections.api.RichIterable.detect.

Returns the first element of the iterable for which the predicate evaluates to true or null in the case where no element returns true.

public int
detectIndex(Predicate<? super T> predicate)

Overrides org.eclipse.collections.impl.list.mutable.AbstractMutableList.detectIndex.

Implements org.eclipse.collections.api.ordered.OrderedIterable.detectIndex.

Returns the index of the first element of the OrderedIterable for which the predicate evaluates to true.

public int
detectLastIndex(Predicate<? super T> predicate)

Overrides org.eclipse.collections.impl.list.mutable.AbstractMutableList.detectLastIndex.

Implements org.eclipse.collections.api.ordered.ReversibleIterable.detectLastIndex.

Returns the index of the last element of the ReversibleIterable for which the predicate evaluates to true.

public Optional<T>
detectOptional(Predicate<? super T> predicate)

Overrides org.eclipse.collections.impl.list.mutable.AbstractMutableList.detectOptional.

Implements org.eclipse.collections.api.RichIterable.detectOptional.

Returns the first element of the iterable for which the predicate evaluates to true as an Optional.

public <P> T
detectWith(Predicate2<? super T, ? super P> predicate, P parameter)

Overrides org.eclipse.collections.impl.list.mutable.AbstractMutableList.detectWith.

Implements org.eclipse.collections.api.RichIterable.detectWith.

Returns the first element that evaluates to true for the specified predicate2 and parameter, or null if none evaluate to true.

public <P> Optional<T>
detectWithOptional(Predicate2<? super T, ? super P> predicate, P parameter)

Overrides org.eclipse.collections.impl.list.mutable.AbstractMutableList.detectWithOptional.

Implements org.eclipse.collections.api.RichIterable.detectWithOptional.

Returns the first element that evaluates to true for the specified predicate2 and parameter as an Optional.

public MutableList<T>
distinct()

Overrides org.eclipse.collections.impl.list.mutable.AbstractMutableList.distinct.

Implements org.eclipse.collections.api.list.MutableList.distinct.

Returns a new ListIterable containing the distinct elements in this list.

public MutableList<T>
distinct(HashingStrategy<? super T> hashingStrategy)

Overrides org.eclipse.collections.impl.list.mutable.AbstractMutableList.distinct.

Implements org.eclipse.collections.api.list.MutableList.distinct.

Returns a new ListIterable containing the distinct elements in this list.

public MutableList<T>
drop(int count)

Overrides org.eclipse.collections.impl.list.mutable.AbstractMutableList.drop.

Implements org.eclipse.collections.api.list.MutableList.drop.

Returns an iterable after skipping the first count elements or an empty iterable if the count is greater than the length of the iterable.

public void
each(Procedure<? super T> procedure)

Overrides org.eclipse.collections.impl.list.mutable.AbstractMutableList.each.

Implements org.eclipse.collections.api.RichIterable.each.

The procedure is executed for each element in the iterable.

public boolean
public <V> MutableList<V>
public <V, R extends Collection<V>> R
flatCollect(Function<? super T, ? extends Iterable<V>> function, R target)

Overrides org.eclipse.collections.impl.list.mutable.AbstractMutableList.flatCollect.

Implements org.eclipse.collections.api.RichIterable.flatCollect.

Same as flatCollect, only the results are collected into the target collection.

public void
forEach(int fromIndex, int toIndex, Procedure<? super T> procedure)

Overrides org.eclipse.collections.impl.list.mutable.AbstractMutableList.forEach.

Implements org.eclipse.collections.api.ordered.OrderedIterable.forEach.

Iterates over the section of the iterable covered by the specified inclusive indexes.

public <P> void
forEachWith(Procedure2<? super T, ? super P> procedure, P parameter)

Overrides org.eclipse.collections.impl.list.mutable.AbstractMutableList.forEachWith.

Implements org.eclipse.collections.api.InternalIterable.forEachWith.

The procedure2 is evaluated for each element in the iterable with the specified parameter provided as the second argument.

public void
forEachWithIndex(ObjectIntProcedure<? super T> objectIntProcedure)

Overrides org.eclipse.collections.impl.list.mutable.AbstractMutableList.forEachWithIndex.

Implements org.eclipse.collections.api.InternalIterable.forEachWithIndex, org.eclipse.collections.api.ordered.OrderedIterable.forEachWithIndex.

Iterates over the iterable passing each element and the current relative int index to the specified instance of ObjectIntProcedure.

public void
forEachWithIndex(int fromIndex, int toIndex, ObjectIntProcedure<? super T> objectIntProcedure)

Overrides org.eclipse.collections.impl.list.mutable.AbstractMutableList.forEachWithIndex.

Implements org.eclipse.collections.api.ordered.OrderedIterable.forEachWithIndex.

Iterates over the section of the iterable covered by the specified inclusive indexes.

public T
get(int index)

Implements java.util.List.get, org.eclipse.collections.api.list.ListIterable.get.

Returns the element at the specified position in this list.

public T
getFirst()

Overrides org.eclipse.collections.impl.list.mutable.AbstractMutableList.getFirst.

Overrides default org.eclipse.collections.api.list.MutableList.getFirst.

Implements org.eclipse.collections.api.RichIterable.getFirst.

This default override exists because java.util.List added a default getFirst() method in Java 21.

public T
getLast()

Overrides org.eclipse.collections.impl.list.mutable.AbstractMutableList.getLast.

Overrides default org.eclipse.collections.api.list.MutableList.getLast.

Implements org.eclipse.collections.api.RichIterable.getLast.

This default override exists because java.util.List added a default getLast() method in Java 21.

public int
public int
indexOf(Object item)

Overrides org.eclipse.collections.impl.list.mutable.AbstractMutableList.indexOf.

Overrides default org.eclipse.collections.api.list.MutableList.indexOf.

Returns the index of the first occurrence of the specified element in this list, or -1 if this list does not contain the element.

public <IV> IV
injectInto(IV injectedValue, Function2<? super IV, ? super T, ? extends IV> function)

Overrides org.eclipse.collections.impl.list.mutable.AbstractMutableList.injectInto.

Implements org.eclipse.collections.api.RichIterable.injectInto.

Returns the final result of evaluating function using each element of the iterable and the previous evaluation result as the parameters.

public <IV, P> IV
injectIntoWith(IV injectValue, Function3<? super IV, ? super T, ? super P, ? extends IV> function, P parameter)

Overrides org.eclipse.collections.impl.list.mutable.AbstractMutableList.injectIntoWith.

Implements org.eclipse.collections.api.collection.MutableCollection.injectIntoWith.

Returns the final result of evaluating function using each element of the iterable, the previous evaluation result and the parameters.

public boolean
public Iterator<T>
public int
lastIndexOf(Object item)

Overrides org.eclipse.collections.impl.list.mutable.AbstractMutableList.lastIndexOf.

Implements java.util.List.lastIndexOf, org.eclipse.collections.api.list.ListIterable.lastIndexOf.

Returns the index of the last occurrence of the specified element in this list, or -1 if this list does not contain the element.

public ListIterator<T>
listIterator(int index)

Overrides org.eclipse.collections.impl.list.mutable.AbstractMutableList.listIterator.

Implements java.util.List.listIterator, org.eclipse.collections.api.list.ListIterable.listIterator.

Returns a list iterator over the elements in this list (in proper sequence), starting at the specified position in the list.

public boolean
noneSatisfy(Predicate<? super T> predicate)

Overrides org.eclipse.collections.impl.list.mutable.AbstractMutableList.noneSatisfy.

Implements org.eclipse.collections.api.RichIterable.noneSatisfy.

Returns true if the predicate evaluates to false for every element of the iterable or if the iterable is empty.

public <P> boolean
noneSatisfyWith(Predicate2<? super T, ? super P> predicate, P parameter)

Overrides org.eclipse.collections.impl.list.mutable.AbstractMutableList.noneSatisfyWith.

Implements org.eclipse.collections.api.RichIterable.noneSatisfyWith.

Returns true if the predicate evaluates to false for every element of the collection, or return false.

public boolean
notEmpty()

Overrides default org.eclipse.collections.api.RichIterable.notEmpty.

The English equivalent of !this.isEmpty()

public <R extends Collection<T>> R
reject(Predicate<? super T> predicate, R target)

Overrides org.eclipse.collections.impl.list.mutable.AbstractMutableList.reject.

Implements org.eclipse.collections.api.RichIterable.reject.

Same as the reject method with one parameter but uses the specified target collection for the results.

public <P, R extends Collection<T>> R
rejectWith(Predicate2<? super T, ? super P> predicate, P parameter, R target)

Overrides org.eclipse.collections.impl.list.mutable.AbstractMutableList.rejectWith.

Implements org.eclipse.collections.api.RichIterable.rejectWith.

Similar to reject(Predicate, Collection), except with an evaluation parameter for the second generic argument in Predicate2.

public boolean
remove(Object o)

Overrides org.eclipse.collections.impl.collection.mutable.AbstractMutableCollection.remove.

Implements java.util.Collection.remove, java.util.List.remove.

Removes the first occurrence of the specified element from this list, if it is present (optional operation).

public T
remove(int index)

Implements java.util.List.remove.

Removes the element at the specified position in this list (optional operation).

public boolean
removeAll(Collection<?> collection)

Overrides org.eclipse.collections.impl.list.mutable.AbstractMutableList.removeAll.

Implements java.util.Collection.removeAll, java.util.List.removeAll.

Removes from this list all of its elements that are contained in the specified collection (optional operation).

public boolean
public boolean
removeIf(Predicate<? super T> predicate)

Overrides org.eclipse.collections.impl.list.mutable.AbstractMutableList.removeIf.

Implements org.eclipse.collections.api.collection.MutableCollection.removeIf.

Removes all elements in the collection that evaluate to true for the specified predicate.

public <P> boolean
removeIfWith(Predicate2<? super T, ? super P> predicate, P parameter)

Overrides org.eclipse.collections.impl.list.mutable.AbstractMutableList.removeIfWith.

Implements org.eclipse.collections.api.collection.MutableCollection.removeIfWith.

Removes all elements in the collection that evaluate to true for the specified predicate2 and parameter.

public void
replaceAll(UnaryOperator<T> operator)

Overrides default java.util.List.replaceAll.

Replaces each element of this list with the result of applying the operator to that element (optional operation).

public boolean
retainAll(Collection<?> collection)

Overrides org.eclipse.collections.impl.list.mutable.AbstractMutableList.retainAll.

Implements java.util.Collection.retainAll, java.util.List.retainAll.

Retains only the elements in this list that are contained in the specified collection (optional operation).

public boolean
public <R extends Collection<T>> R
select(Predicate<? super T> predicate, R target)

Overrides org.eclipse.collections.impl.list.mutable.AbstractMutableList.select.

Implements org.eclipse.collections.api.RichIterable.select.

Same as the select method with one parameter but uses the specified target collection for the results.

public <P> Twin<MutableList<T>>
selectAndRejectWith(Predicate2<? super T, ? super P> predicate, P parameter)

Overrides org.eclipse.collections.impl.list.mutable.AbstractMutableList.selectAndRejectWith.

Implements org.eclipse.collections.api.collection.MutableCollection.selectAndRejectWith.

Filters a collection into two separate collections based on a predicate returned via a Pair.

public <P, R extends Collection<T>> R
selectWith(Predicate2<? super T, ? super P> predicate, P parameter, R target)

Overrides org.eclipse.collections.impl.list.mutable.AbstractMutableList.selectWith.

Implements org.eclipse.collections.api.RichIterable.selectWith.

Similar to select(Predicate, Collection), except with an evaluation parameter for the second generic argument in Predicate2.

public int
size()

Implements java.util.Collection.size, org.eclipse.collections.api.RichIterable.size, java.util.List.size.

Returns the number of elements in this list.

public void
sort(Comparator<? super T> comparator)

Overrides default java.util.List.sort.

Sorts this list according to the order induced by the specified Comparator (optional operation).

public MutableList<T>
subList(int fromIndex, int toIndex)

Overrides org.eclipse.collections.impl.list.mutable.AbstractMutableList.subList.

Implements org.eclipse.collections.api.list.MutableList.subList.

Returns a view of the portion of this list between the specified fromIndex, inclusive, and toIndex, exclusive.

public MutableList<T>
take(int count)

Overrides org.eclipse.collections.impl.list.mutable.AbstractMutableList.take.

Implements org.eclipse.collections.api.list.MutableList.take.

Returns the first count elements of the iterable or all the elements in the iterable if count is greater than the length of the iterable.

public Object[]
toArray()

Overrides default org.eclipse.collections.api.list.MutableList.toArray, org.eclipse.collections.api.collection.MutableCollection.toArray, org.eclipse.collections.api.RichIterable.toArray.

Returns an array containing all of the elements in this list in proper sequence (from first to last element).

public <E> E[]
toArray(E[] array)

Overrides default org.eclipse.collections.api.list.MutableList.toArray, org.eclipse.collections.api.collection.MutableCollection.toArray, org.eclipse.collections.api.RichIterable.toArray.

Returns an array containing all of the elements in this list in proper sequence (from first to last element); the runtime type of the returned array is that of the specified array.

Inherited from org.eclipse.collections.impl.list.mutable.AbstractMutableList:
appendStringasParallelasReversedasSynchronizedasUnmodifiablebinarySearchchunkclonecontainsAlldistinctBydropWhilegroupBygroupByEachgroupByUniqueKeyinjectIntoinjectIntoinjectIntolistIteratormaxmaxmaxByminminminBynewEmptypartitionpartitionWhilepartitionWithremoveRangeselectInstancesOfsortThisByBooleansortThisByBytesortThisByCharsortThisByDoublesortThisByFloatsortThisByIntsortThisByLongsortThisByShortsumOfDoublesumOfFloatsumOfIntsumOfLongtakeWhiletaptoSettoSortedListzipzipzipWithIndexzipWithIndex