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
All Methods Instance Methods Abstract Methods Default Methods 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.default MutableLongList
rejectWithIndex(LongIntPredicate predicate)
Returns a new MutableLongList excluding all elements with corresponding indexes matching 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.default MutableLongList
selectWithIndex(LongIntPredicate predicate)
Returns a new MutableLongList including all elements with corresponding indexes matching 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(java.util.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, java.util.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(java.lang.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, 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.LongList
binarySearch, dotProduct, equals, forEachInBoth, 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, 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.ReversibleLongIterable
asReversed, getLast, injectIntoWithIndex
-
-
-
-
Method Detail
-
addAtIndex
void addAtIndex(int index, long element)
-
addAllAtIndex
boolean addAllAtIndex(int index, long... source)
-
addAllAtIndex
boolean addAllAtIndex(int index, LongIterable source)
-
removeAtIndex
long removeAtIndex(int index)
-
set
long set(int index, long element)
-
swap
default void swap(int index1, int index2)
-
select
MutableLongList select(LongPredicate predicate)
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
MutableLongList reject(LongPredicate predicate)
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
MutableLongList with(long element)
- Specified by:
with
in interfaceMutableLongCollection
-
without
MutableLongList without(long element)
- Specified by:
without
in interfaceMutableLongCollection
-
withAll
MutableLongList withAll(LongIterable elements)
- Specified by:
withAll
in interfaceMutableLongCollection
-
withoutAll
MutableLongList withoutAll(LongIterable elements)
- Specified by:
withoutAll
in interfaceMutableLongCollection
-
tap
default MutableLongList tap(LongProcedure procedure)
- Specified by:
tap
in interfaceLongIterable
- Specified by:
tap
in interfaceLongList
- Specified by:
tap
in interfaceMutableLongCollection
- Since:
- 9.0.
-
selectWithIndex
default MutableLongList selectWithIndex(LongIntPredicate predicate)
Returns a new MutableLongList including all elements with corresponding indexes matching the specified predicate.- Specified by:
selectWithIndex
in interfaceLongList
- Specified by:
selectWithIndex
in interfaceOrderedLongIterable
- Specified by:
selectWithIndex
in interfaceReversibleLongIterable
- Since:
- 11.1.
-
rejectWithIndex
default MutableLongList rejectWithIndex(LongIntPredicate predicate)
Returns a new MutableLongList excluding all elements with corresponding indexes matching the specified predicate.- Specified by:
rejectWithIndex
in interfaceLongList
- Specified by:
rejectWithIndex
in interfaceOrderedLongIterable
- Specified by:
rejectWithIndex
in interfaceReversibleLongIterable
- Since:
- 11.1.
-
collect
<V> MutableList<V> collect(LongToObjectFunction<? extends V> function)
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
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.- 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
default MutableLongList sortThis(LongComparator comparator)
Sorts the internal data structure of this list and returns the list itself as a convenience.
-
sortThisBy
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
.
-
sortThisBy
default <T> MutableLongList sortThisBy(LongToObjectFunction<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 MutableLongList shuffleThis()
Randomly permutes this list mutating its contents and returns the same list (this). Usesjava.util.Random
as the source of randomness.
-
shuffleThis
default MutableLongList 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
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
MutableLongList subList(int fromIndex, int toIndex)
-
zipLong
default MutableList<LongLongPair> zipLong(LongIterable iterable)
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
default <T> MutableList<LongObjectPair<T>> zip(java.lang.Iterable<T> list)
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
default MutableLongList newEmpty()
Creates a new empty mutable version of the same List type.- Specified by:
newEmpty
in interfaceMutableLongCollection
- Since:
- 9.2.
-
-