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
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.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.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(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, 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(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, count, detectIfNone, each, flatCollect, forEach, injectInto, max, maxIfEmpty, median, medianIfEmpty, min, minIfEmpty, noneSatisfy, reduce, reduceIfEmpty, reject, select, sum, summaryStatistics, toArray, toArray, toBag, toList, toSet, toSortedArray, toSortedList
Methods inherited from interface org.eclipse.collections.api.list.primitive.IntList
binarySearch, dotProduct, equals, 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
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 Details
-
addAtIndex
void addAtIndex(int index, int element) -
addAllAtIndex
boolean addAllAtIndex(int index, int... source) -
addAllAtIndex
-
removeAtIndex
int removeAtIndex(int index) -
set
int set(int index, int element) -
swap
default void swap(int index1, int index2) -
select
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
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
- Specified by:
with
in interfaceMutableIntCollection
-
without
- Specified by:
without
in interfaceMutableIntCollection
-
withAll
- Specified by:
withAll
in interfaceMutableIntCollection
-
withoutAll
- Specified by:
withoutAll
in interfaceMutableIntCollection
-
tap
- Specified by:
tap
in interfaceIntIterable
- Specified by:
tap
in interfaceIntList
- Specified by:
tap
in interfaceMutableIntCollection
- Since:
- 9.0.
-
collect
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
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
Sorts the internal data structure of this list and returns the list itself as a convenience. -
sortThisBy
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, Comparator<? super T> comparator)Sorts the internal data structure of this list based on the key returned byfunction
using the providedcomparator
. -
shuffleThis
Randomly permutes this list mutating its contents and returns the same list (this). Usesjava.util.Random
as the source of randomness. -
shuffleThis
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
- Specified by:
subList
in interfaceIntList
- See Also:
List.subList(int fromIndex, int toIndex)
-
zipInt
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
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
Creates a new empty mutable version of the same List type.- Specified by:
newEmpty
in interfaceMutableIntCollection
- Since:
- 9.2.
-