Interface MutableLongList
- All Superinterfaces:
LongIterable
,LongList
,MutableLongCollection
,OrderedLongIterable
,PrimitiveIterable
,ReversibleLongIterable
- All Known Implementing Classes:
LongArrayList
,SynchronizedLongList
,UnmodifiableLongList
public interface MutableLongList extends MutableLongCollection, LongList
This file was automatically generated from template file mutablePrimitiveList.stg.
- Since:
- 3.0.
-
Method Summary
Modifier and Type Method Description boolean
addAllAtIndex(int index, long... source)
boolean
addAllAtIndex(int index, LongIterable source)
void
addAtIndex(int index, long element)
MutableLongList
asSynchronized()
MutableLongList
asUnmodifiable()
<V> MutableList<V>
collect(LongToObjectFunction<? 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(LongIntToObjectFunction<? extends V> function)
Returns a new MutableList using results obtained by applying the specified function to each element and its corresponding index.MutableLongList
distinct()
default MutableLongList
newEmpty()
Creates a new empty mutable version of the same List type.MutableLongList
reject(LongPredicate predicate)
Returns a new LongIterable with all of the elements in the LongIterable that return false for the specified predicate.long
removeAtIndex(int index)
MutableLongList
reverseThis()
MutableLongList
select(LongPredicate predicate)
Returns a new LongIterable with all of the elements in the LongIterable that return true for the specified predicate.long
set(int index, long element)
default MutableLongList
shuffleThis()
Randomly permutes this list mutating its contents and returns the same list (this).default MutableLongList
shuffleThis(Random rnd)
Randomly permutes this list mutating its contents and returns the same list (this).MutableLongList
sortThis()
Sorts this list mutating its contents and returns the same mutable list (this).default MutableLongList
sortThis(LongComparator comparator)
Sorts the internal data structure of this list and returns the list itself as a convenience.default <T> MutableLongList
sortThisBy(LongToObjectFunction<T> function)
Sorts the internal data structure of this list based on the natural order of the key returned byfunction
.default <T> MutableLongList
sortThisBy(LongToObjectFunction<T> function, Comparator<? super T> comparator)
Sorts the internal data structure of this list based on the key returned byfunction
using the providedcomparator
.MutableLongList
subList(int fromIndex, int toIndex)
default void
swap(int index1, int index2)
default MutableLongList
tap(LongProcedure procedure)
ImmutableLongList
toImmutable()
Returns an immutable copy of this list.MutableLongList
toReversed()
MutableLongList
with(long element)
MutableLongList
withAll(LongIterable elements)
MutableLongList
without(long element)
MutableLongList
withoutAll(LongIterable elements)
default <T> MutableList<LongObjectPair<T>>
zip(Iterable<T> list)
Returns aMutableList
formed from thisMutableLongList
and aListIterable
by combining corresponding elements in pairs.default MutableList<LongLongPair>
zipLong(LongIterable iterable)
Returns aMutableList
formed from thisMutableLongList
and anotherLongList
by combining corresponding elements in pairs.Methods inherited from interface org.eclipse.collections.api.LongIterable
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.LongList
binarySearch, dotProduct, equals, get, hashCode, lastIndexOf, primitiveParallelStream, primitiveStream, spliterator
Methods inherited from interface org.eclipse.collections.api.collection.primitive.MutableLongCollection
add, addAll, addAll, clear, longIterator, remove, removeAll, removeAll, removeIf, retainAll, retainAll
Methods inherited from interface org.eclipse.collections.api.ordered.primitive.OrderedLongIterable
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.ReversibleLongIterable
asReversed, getLast, injectIntoWithIndex
-
Method Details
-
addAtIndex
void addAtIndex(int index, long element) -
addAllAtIndex
boolean addAllAtIndex(int index, long... source) -
addAllAtIndex
-
removeAtIndex
long removeAtIndex(int index) -
set
long set(int index, long element) -
swap
default void swap(int index1, int index2) -
select
Description copied from interface:LongIterable
Returns a new LongIterable with all of the elements in the LongIterable that return true for the specified predicate.- Specified by:
select
in interfaceLongIterable
- Specified by:
select
in interfaceLongList
- Specified by:
select
in interfaceMutableLongCollection
- Specified by:
select
in interfaceOrderedLongIterable
- Specified by:
select
in interfaceReversibleLongIterable
-
reject
Description copied from interface:LongIterable
Returns a new LongIterable with all of the elements in the LongIterable that return false for the specified predicate.- Specified by:
reject
in interfaceLongIterable
- Specified by:
reject
in interfaceLongList
- Specified by:
reject
in interfaceMutableLongCollection
- Specified by:
reject
in interfaceOrderedLongIterable
- Specified by:
reject
in interfaceReversibleLongIterable
-
with
- Specified by:
with
in interfaceMutableLongCollection
-
without
- Specified by:
without
in interfaceMutableLongCollection
-
withAll
- Specified by:
withAll
in interfaceMutableLongCollection
-
withoutAll
- Specified by:
withoutAll
in interfaceMutableLongCollection
-
tap
- Specified by:
tap
in interfaceLongIterable
- Specified by:
tap
in interfaceLongList
- Specified by:
tap
in interfaceMutableLongCollection
- Since:
- 9.0.
-
collect
Description copied from interface:LongIterable
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 interfaceLongIterable
- Specified by:
collect
in interfaceLongList
- Specified by:
collect
in interfaceMutableLongCollection
- Specified by:
collect
in interfaceOrderedLongIterable
- Specified by:
collect
in interfaceReversibleLongIterable
-
collectWithIndex
Returns a new MutableList using results obtained by applying the specified function to each element and its corresponding index.- Specified by:
collectWithIndex
in interfaceLongList
- Specified by:
collectWithIndex
in interfaceOrderedLongIterable
- Specified by:
collectWithIndex
in interfaceReversibleLongIterable
- Since:
- 9.1.
-
reverseThis
MutableLongList reverseThis() -
toReversed
MutableLongList toReversed()- Specified by:
toReversed
in interfaceLongList
- Specified by:
toReversed
in interfaceReversibleLongIterable
-
distinct
MutableLongList distinct()- Specified by:
distinct
in interfaceLongList
- Specified by:
distinct
in interfaceReversibleLongIterable
- Since:
- 6.0.
-
sortThis
MutableLongList 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> MutableLongList sortThisBy(LongToObjectFunction<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
MutableLongList asUnmodifiable()- Specified by:
asUnmodifiable
in interfaceMutableLongCollection
-
asSynchronized
MutableLongList asSynchronized()- Specified by:
asSynchronized
in interfaceMutableLongCollection
-
toImmutable
ImmutableLongList toImmutable()Returns an immutable copy of this list.- Specified by:
toImmutable
in interfaceLongList
- Specified by:
toImmutable
in interfaceMutableLongCollection
-
subList
- Specified by:
subList
in interfaceLongList
- See Also:
List.subList(int fromIndex, int toIndex)
-
zipLong
Returns aMutableList
formed from thisMutableLongList
and anotherLongList
by combining corresponding elements in pairs. If one of the twoLongList
s is longer than the other, its remaining elements are ignored. -
zip
Returns aMutableList
formed from thisMutableLongList
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 interfaceMutableLongCollection
- Since:
- 9.2.
-