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
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.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.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(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, 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(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
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, 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.ShortList
binarySearch, dotProduct, equals, get, hashCode, lastIndexOf
-
Method Details
-
addAtIndex
void addAtIndex(int index, short element) -
addAllAtIndex
boolean addAllAtIndex(int index, short... source) -
addAllAtIndex
-
removeAtIndex
short removeAtIndex(int index) -
set
short set(int index, short element) -
swap
default void swap(int index1, int index2) -
select
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
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
- Specified by:
with
in interfaceMutableShortCollection
-
without
- Specified by:
without
in interfaceMutableShortCollection
-
withAll
- Specified by:
withAll
in interfaceMutableShortCollection
-
withoutAll
- Specified by:
withoutAll
in interfaceMutableShortCollection
-
tap
- Specified by:
tap
in interfaceMutableShortCollection
- Specified by:
tap
in interfaceShortIterable
- Specified by:
tap
in interfaceShortList
- Since:
- 9.0.
-
collect
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
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
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> MutableShortList sortThisBy(ShortToObjectFunction<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
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
- Specified by:
subList
in interfaceShortList
- See Also:
List.subList(int fromIndex, int toIndex)
-
zipShort
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
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
Creates a new empty mutable version of the same List type.- Specified by:
newEmpty
in interfaceMutableShortCollection
- Since:
- 9.2.
-