Interface MutableIntList
-
- All Superinterfaces:
IntIterable
,IntList
,MutableIntCollection
,OrderedIntIterable
,PrimitiveIterable
,ReversibleIntIterable
- All Known Implementing Classes:
IntArrayList
,SynchronizedIntList
,UnmodifiableIntList
public interface MutableIntList extends MutableIntCollection, IntList
This file was automatically generated from template file mutablePrimitiveList.stg.- Since:
- 3.0.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description boolean
addAllAtIndex(int index, int... source)
boolean
addAllAtIndex(int index, IntIterable source)
void
addAtIndex(int index, int element)
MutableIntList
asSynchronized()
MutableIntList
asUnmodifiable()
<V> MutableList<V>
collect(IntToObjectFunction<? extends V> function)
Returns a new collection with the results of applying the specified function on each element of the source collection.default <V> MutableList<V>
collectWithIndex(IntIntToObjectFunction<? extends V> function)
Returns a new MutableList using results obtained by applying the specified function to each element and its corresponding index.MutableIntList
distinct()
default MutableIntList
newEmpty()
Creates a new empty mutable version of the same List type.MutableIntList
reject(IntPredicate predicate)
Returns a new IntIterable with all of the elements in the IntIterable that return false for the specified predicate.default MutableIntList
rejectWithIndex(IntIntPredicate predicate)
Returns a new MutableIntList excluding all elements with corresponding indexes matching the specified predicate.int
removeAtIndex(int index)
MutableIntList
reverseThis()
MutableIntList
select(IntPredicate predicate)
Returns a new IntIterable with all of the elements in the IntIterable that return true for the specified predicate.default MutableIntList
selectWithIndex(IntIntPredicate predicate)
Returns a new MutableIntList including all elements with corresponding indexes matching the specified predicate.int
set(int index, int element)
default MutableIntList
shuffleThis()
Randomly permutes this list mutating its contents and returns the same list (this).default MutableIntList
shuffleThis(java.util.Random rnd)
Randomly permutes this list mutating its contents and returns the same list (this).MutableIntList
sortThis()
Sorts this list mutating its contents and returns the same mutable list (this).default MutableIntList
sortThis(IntComparator comparator)
Sorts the internal data structure of this list and returns the list itself as a convenience.default <T> MutableIntList
sortThisBy(IntToObjectFunction<T> function)
Sorts the internal data structure of this list based on the natural order of the key returned byfunction
.default <T> MutableIntList
sortThisBy(IntToObjectFunction<T> function, java.util.Comparator<? super T> comparator)
Sorts the internal data structure of this list based on the key returned byfunction
using the providedcomparator
.MutableIntList
subList(int fromIndex, int toIndex)
default void
swap(int index1, int index2)
default MutableIntList
tap(IntProcedure procedure)
ImmutableIntList
toImmutable()
Returns an immutable copy of this list.MutableIntList
toReversed()
MutableIntList
with(int element)
MutableIntList
withAll(IntIterable elements)
MutableIntList
without(int element)
MutableIntList
withoutAll(IntIterable elements)
default <T> MutableList<IntObjectPair<T>>
zip(java.lang.Iterable<T> list)
Returns aMutableList
formed from thisMutableIntList
and aListIterable
by combining corresponding elements in pairs.default MutableList<IntIntPair>
zipInt(IntIterable iterable)
Returns aMutableList
formed from thisMutableIntList
and anotherIntList
by combining corresponding elements in pairs.-
Methods inherited from interface org.eclipse.collections.api.IntIterable
allSatisfy, anySatisfy, asLazy, average, averageIfEmpty, chunk, collect, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectInt, collectLong, collectShort, contains, containsAll, containsAll, containsAny, containsAny, containsNone, containsNone, count, detectIfNone, each, flatCollect, forEach, injectInto, injectIntoBoolean, injectIntoByte, injectIntoChar, injectIntoDouble, injectIntoFloat, injectIntoInt, injectIntoLong, injectIntoShort, max, maxIfEmpty, median, medianIfEmpty, min, minIfEmpty, noneSatisfy, reduce, reduceIfEmpty, reject, select, sum, summaryStatistics, toArray, toArray, toBag, toList, toSet, toSortedArray, toSortedList, toSortedList, toSortedListBy, toSortedListBy
-
Methods inherited from interface org.eclipse.collections.api.list.primitive.IntList
binarySearch, dotProduct, equals, forEachInBoth, get, hashCode, lastIndexOf, primitiveParallelStream, primitiveStream, spliterator
-
Methods inherited from interface org.eclipse.collections.api.collection.primitive.MutableIntCollection
add, addAll, addAll, clear, intIterator, remove, removeAll, removeAll, removeIf, retainAll, retainAll
-
Methods inherited from interface org.eclipse.collections.api.ordered.primitive.OrderedIntIterable
collectWithIndex, forEachWithIndex, getFirst, indexOf, rejectWithIndex, selectWithIndex
-
Methods inherited from interface org.eclipse.collections.api.PrimitiveIterable
appendString, appendString, appendString, isEmpty, makeString, makeString, makeString, notEmpty, size, toString
-
Methods inherited from interface org.eclipse.collections.api.ordered.primitive.ReversibleIntIterable
asReversed, getLast, injectIntoWithIndex
-
-
-
-
Method Detail
-
addAtIndex
void addAtIndex(int index, int element)
-
addAllAtIndex
boolean addAllAtIndex(int index, int... source)
-
addAllAtIndex
boolean addAllAtIndex(int index, IntIterable source)
-
removeAtIndex
int removeAtIndex(int index)
-
set
int set(int index, int element)
-
swap
default void swap(int index1, int index2)
-
select
MutableIntList select(IntPredicate predicate)
Description copied from interface:IntIterable
Returns a new IntIterable with all of the elements in the IntIterable that return true for the specified predicate.- Specified by:
select
in interfaceIntIterable
- Specified by:
select
in interfaceIntList
- Specified by:
select
in interfaceMutableIntCollection
- Specified by:
select
in interfaceOrderedIntIterable
- Specified by:
select
in interfaceReversibleIntIterable
-
reject
MutableIntList reject(IntPredicate predicate)
Description copied from interface:IntIterable
Returns a new IntIterable with all of the elements in the IntIterable that return false for the specified predicate.- Specified by:
reject
in interfaceIntIterable
- Specified by:
reject
in interfaceIntList
- Specified by:
reject
in interfaceMutableIntCollection
- Specified by:
reject
in interfaceOrderedIntIterable
- Specified by:
reject
in interfaceReversibleIntIterable
-
with
MutableIntList with(int element)
- Specified by:
with
in interfaceMutableIntCollection
-
without
MutableIntList without(int element)
- Specified by:
without
in interfaceMutableIntCollection
-
withAll
MutableIntList withAll(IntIterable elements)
- Specified by:
withAll
in interfaceMutableIntCollection
-
withoutAll
MutableIntList withoutAll(IntIterable elements)
- Specified by:
withoutAll
in interfaceMutableIntCollection
-
tap
default MutableIntList tap(IntProcedure procedure)
- Specified by:
tap
in interfaceIntIterable
- Specified by:
tap
in interfaceIntList
- Specified by:
tap
in interfaceMutableIntCollection
- Since:
- 9.0.
-
selectWithIndex
default MutableIntList selectWithIndex(IntIntPredicate predicate)
Returns a new MutableIntList including all elements with corresponding indexes matching the specified predicate.- Specified by:
selectWithIndex
in interfaceIntList
- Specified by:
selectWithIndex
in interfaceOrderedIntIterable
- Specified by:
selectWithIndex
in interfaceReversibleIntIterable
- Since:
- 11.1.
-
rejectWithIndex
default MutableIntList rejectWithIndex(IntIntPredicate predicate)
Returns a new MutableIntList excluding all elements with corresponding indexes matching the specified predicate.- Specified by:
rejectWithIndex
in interfaceIntList
- Specified by:
rejectWithIndex
in interfaceOrderedIntIterable
- Specified by:
rejectWithIndex
in interfaceReversibleIntIterable
- Since:
- 11.1.
-
collect
<V> MutableList<V> collect(IntToObjectFunction<? extends V> function)
Description copied from interface:IntIterable
Returns a new collection with the results of applying the specified function on each element of the source collection. This method is also commonly called transform or map.- Specified by:
collect
in interfaceIntIterable
- Specified by:
collect
in interfaceIntList
- Specified by:
collect
in interfaceMutableIntCollection
- Specified by:
collect
in interfaceOrderedIntIterable
- Specified by:
collect
in interfaceReversibleIntIterable
-
collectWithIndex
default <V> MutableList<V> collectWithIndex(IntIntToObjectFunction<? extends V> function)
Returns a new MutableList using results obtained by applying the specified function to each element and its corresponding index.- Specified by:
collectWithIndex
in interfaceIntList
- Specified by:
collectWithIndex
in interfaceOrderedIntIterable
- Specified by:
collectWithIndex
in interfaceReversibleIntIterable
- Since:
- 9.1.
-
reverseThis
MutableIntList reverseThis()
-
toReversed
MutableIntList toReversed()
- Specified by:
toReversed
in interfaceIntList
- Specified by:
toReversed
in interfaceReversibleIntIterable
-
distinct
MutableIntList distinct()
- Specified by:
distinct
in interfaceIntList
- Specified by:
distinct
in interfaceReversibleIntIterable
- Since:
- 6.0.
-
sortThis
MutableIntList sortThis()
Sorts this list mutating its contents and returns the same mutable list (this).
-
sortThis
default MutableIntList sortThis(IntComparator comparator)
Sorts the internal data structure of this list and returns the list itself as a convenience.
-
sortThisBy
default <T> MutableIntList sortThisBy(IntToObjectFunction<T> function)
Sorts the internal data structure of this list based on the natural order of the key returned byfunction
.
-
sortThisBy
default <T> MutableIntList sortThisBy(IntToObjectFunction<T> function, java.util.Comparator<? super T> comparator)
Sorts the internal data structure of this list based on the key returned byfunction
using the providedcomparator
.
-
shuffleThis
default MutableIntList shuffleThis()
Randomly permutes this list mutating its contents and returns the same list (this). Usesjava.util.Random
as the source of randomness.
-
shuffleThis
default MutableIntList shuffleThis(java.util.Random rnd)
Randomly permutes this list mutating its contents and returns the same list (this). Implements the Fisher-Yates shuffle algorithm using the provided source of randomness.
-
asUnmodifiable
MutableIntList asUnmodifiable()
- Specified by:
asUnmodifiable
in interfaceMutableIntCollection
-
asSynchronized
MutableIntList asSynchronized()
- Specified by:
asSynchronized
in interfaceMutableIntCollection
-
toImmutable
ImmutableIntList toImmutable()
Returns an immutable copy of this list.- Specified by:
toImmutable
in interfaceIntList
- Specified by:
toImmutable
in interfaceMutableIntCollection
-
subList
MutableIntList subList(int fromIndex, int toIndex)
-
zipInt
default MutableList<IntIntPair> zipInt(IntIterable iterable)
Returns aMutableList
formed from thisMutableIntList
and anotherIntList
by combining corresponding elements in pairs. If one of the twoIntList
s is longer than the other, its remaining elements are ignored.
-
zip
default <T> MutableList<IntObjectPair<T>> zip(java.lang.Iterable<T> list)
Returns aMutableList
formed from thisMutableIntList
and aListIterable
by combining corresponding elements in pairs. If one of the two Lists is longer than the other, its remaining elements are ignored.
-
newEmpty
default MutableIntList newEmpty()
Creates a new empty mutable version of the same List type.- Specified by:
newEmpty
in interfaceMutableIntCollection
- Since:
- 9.2.
-
-