Interface MutableShortList
-
- All Superinterfaces:
MutableShortCollection
,OrderedShortIterable
,PrimitiveIterable
,ReversibleShortIterable
,ShortIterable
,ShortList
- All Known Implementing Classes:
ShortArrayList
,SynchronizedShortList
,UnmodifiableShortList
public interface MutableShortList extends MutableShortCollection, ShortList
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, short... source)
boolean
addAllAtIndex(int index, ShortIterable source)
void
addAtIndex(int index, short element)
MutableShortList
asSynchronized()
MutableShortList
asUnmodifiable()
<V> MutableList<V>
collect(ShortToObjectFunction<? 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(ShortIntToObjectFunction<? extends V> function)
Returns a new MutableList using results obtained by applying the specified function to each element and its corresponding index.MutableShortList
distinct()
default MutableShortList
newEmpty()
Creates a new empty mutable version of the same List type.MutableShortList
reject(ShortPredicate predicate)
Returns a new ShortIterable with all of the elements in the ShortIterable that return false for the specified predicate.default MutableShortList
rejectWithIndex(ShortIntPredicate predicate)
Returns a new MutableShortList excluding all elements with corresponding indexes matching the specified predicate.short
removeAtIndex(int index)
MutableShortList
reverseThis()
MutableShortList
select(ShortPredicate predicate)
Returns a new ShortIterable with all of the elements in the ShortIterable that return true for the specified predicate.default MutableShortList
selectWithIndex(ShortIntPredicate predicate)
Returns a new MutableShortList including all elements with corresponding indexes matching the specified predicate.short
set(int index, short element)
default MutableShortList
shuffleThis()
Randomly permutes this list mutating its contents and returns the same list (this).default MutableShortList
shuffleThis(java.util.Random rnd)
Randomly permutes this list mutating its contents and returns the same list (this).MutableShortList
sortThis()
Sorts this list mutating its contents and returns the same mutable list (this).default MutableShortList
sortThis(ShortComparator comparator)
Sorts the internal data structure of this list and returns the list itself as a convenience.default <T> MutableShortList
sortThisBy(ShortToObjectFunction<T> function)
Sorts the internal data structure of this list based on the natural order of the key returned byfunction
.default <T> MutableShortList
sortThisBy(ShortToObjectFunction<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
.MutableShortList
subList(int fromIndex, int toIndex)
default void
swap(int index1, int index2)
default MutableShortList
tap(ShortProcedure procedure)
ImmutableShortList
toImmutable()
Returns an immutable copy of this list.MutableShortList
toReversed()
MutableShortList
with(short element)
MutableShortList
withAll(ShortIterable elements)
MutableShortList
without(short element)
MutableShortList
withoutAll(ShortIterable elements)
default <T> MutableList<ShortObjectPair<T>>
zip(java.lang.Iterable<T> list)
Returns aMutableList
formed from thisMutableShortList
and aListIterable
by combining corresponding elements in pairs.default MutableList<ShortShortPair>
zipShort(ShortIterable iterable)
Returns aMutableList
formed from thisMutableShortList
and anotherShortList
by combining corresponding elements in pairs.-
Methods inherited from interface org.eclipse.collections.api.collection.primitive.MutableShortCollection
add, addAll, addAll, clear, remove, removeAll, removeAll, removeIf, retainAll, retainAll, shortIterator
-
Methods inherited from interface org.eclipse.collections.api.ordered.primitive.OrderedShortIterable
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.ReversibleShortIterable
asReversed, getLast, injectIntoWithIndex
-
Methods inherited from interface org.eclipse.collections.api.ShortIterable
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.ShortList
binarySearch, dotProduct, equals, forEachInBoth, get, hashCode, lastIndexOf
-
-
-
-
Method Detail
-
addAtIndex
void addAtIndex(int index, short element)
-
addAllAtIndex
boolean addAllAtIndex(int index, short... source)
-
addAllAtIndex
boolean addAllAtIndex(int index, ShortIterable source)
-
removeAtIndex
short removeAtIndex(int index)
-
set
short set(int index, short element)
-
swap
default void swap(int index1, int index2)
-
select
MutableShortList select(ShortPredicate predicate)
Description copied from interface:ShortIterable
Returns a new ShortIterable with all of the elements in the ShortIterable that return true for the specified predicate.- Specified by:
select
in interfaceMutableShortCollection
- Specified by:
select
in interfaceOrderedShortIterable
- Specified by:
select
in interfaceReversibleShortIterable
- Specified by:
select
in interfaceShortIterable
- Specified by:
select
in interfaceShortList
-
reject
MutableShortList reject(ShortPredicate predicate)
Description copied from interface:ShortIterable
Returns a new ShortIterable with all of the elements in the ShortIterable that return false for the specified predicate.- Specified by:
reject
in interfaceMutableShortCollection
- Specified by:
reject
in interfaceOrderedShortIterable
- Specified by:
reject
in interfaceReversibleShortIterable
- Specified by:
reject
in interfaceShortIterable
- Specified by:
reject
in interfaceShortList
-
with
MutableShortList with(short element)
- Specified by:
with
in interfaceMutableShortCollection
-
without
MutableShortList without(short element)
- Specified by:
without
in interfaceMutableShortCollection
-
withAll
MutableShortList withAll(ShortIterable elements)
- Specified by:
withAll
in interfaceMutableShortCollection
-
withoutAll
MutableShortList withoutAll(ShortIterable elements)
- Specified by:
withoutAll
in interfaceMutableShortCollection
-
tap
default MutableShortList tap(ShortProcedure procedure)
- Specified by:
tap
in interfaceMutableShortCollection
- Specified by:
tap
in interfaceShortIterable
- Specified by:
tap
in interfaceShortList
- Since:
- 9.0.
-
selectWithIndex
default MutableShortList selectWithIndex(ShortIntPredicate predicate)
Returns a new MutableShortList including all elements with corresponding indexes matching the specified predicate.- Specified by:
selectWithIndex
in interfaceOrderedShortIterable
- Specified by:
selectWithIndex
in interfaceReversibleShortIterable
- Specified by:
selectWithIndex
in interfaceShortList
- Since:
- 11.1.
-
rejectWithIndex
default MutableShortList rejectWithIndex(ShortIntPredicate predicate)
Returns a new MutableShortList excluding all elements with corresponding indexes matching the specified predicate.- Specified by:
rejectWithIndex
in interfaceOrderedShortIterable
- Specified by:
rejectWithIndex
in interfaceReversibleShortIterable
- Specified by:
rejectWithIndex
in interfaceShortList
- Since:
- 11.1.
-
collect
<V> MutableList<V> collect(ShortToObjectFunction<? extends V> function)
Description copied from interface:ShortIterable
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 interfaceMutableShortCollection
- Specified by:
collect
in interfaceOrderedShortIterable
- Specified by:
collect
in interfaceReversibleShortIterable
- Specified by:
collect
in interfaceShortIterable
- Specified by:
collect
in interfaceShortList
-
collectWithIndex
default <V> MutableList<V> collectWithIndex(ShortIntToObjectFunction<? 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 interfaceOrderedShortIterable
- Specified by:
collectWithIndex
in interfaceReversibleShortIterable
- Specified by:
collectWithIndex
in interfaceShortList
- Since:
- 9.1.
-
reverseThis
MutableShortList reverseThis()
-
toReversed
MutableShortList toReversed()
- Specified by:
toReversed
in interfaceReversibleShortIterable
- Specified by:
toReversed
in interfaceShortList
-
distinct
MutableShortList distinct()
- Specified by:
distinct
in interfaceReversibleShortIterable
- Specified by:
distinct
in interfaceShortList
- Since:
- 6.0.
-
sortThis
MutableShortList sortThis()
Sorts this list mutating its contents and returns the same mutable list (this).
-
sortThis
default MutableShortList sortThis(ShortComparator comparator)
Sorts the internal data structure of this list and returns the list itself as a convenience.
-
sortThisBy
default <T> MutableShortList sortThisBy(ShortToObjectFunction<T> function)
Sorts the internal data structure of this list based on the natural order of the key returned byfunction
.
-
sortThisBy
default <T> MutableShortList sortThisBy(ShortToObjectFunction<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 MutableShortList shuffleThis()
Randomly permutes this list mutating its contents and returns the same list (this). Usesjava.util.Random
as the source of randomness.
-
shuffleThis
default MutableShortList 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
MutableShortList asUnmodifiable()
- Specified by:
asUnmodifiable
in interfaceMutableShortCollection
-
asSynchronized
MutableShortList asSynchronized()
- Specified by:
asSynchronized
in interfaceMutableShortCollection
-
toImmutable
ImmutableShortList toImmutable()
Returns an immutable copy of this list.- Specified by:
toImmutable
in interfaceMutableShortCollection
- Specified by:
toImmutable
in interfaceShortList
-
subList
MutableShortList subList(int fromIndex, int toIndex)
-
zipShort
default MutableList<ShortShortPair> zipShort(ShortIterable iterable)
Returns aMutableList
formed from thisMutableShortList
and anotherShortList
by combining corresponding elements in pairs. If one of the twoShortList
s is longer than the other, its remaining elements are ignored.
-
zip
default <T> MutableList<ShortObjectPair<T>> zip(java.lang.Iterable<T> list)
Returns aMutableList
formed from thisMutableShortList
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 MutableShortList newEmpty()
Creates a new empty mutable version of the same List type.- Specified by:
newEmpty
in interfaceMutableShortCollection
- Since:
- 9.2.
-
-