Class UnmodifiableShortList
- java.lang.Object
-
- org.eclipse.collections.impl.collection.mutable.primitive.AbstractUnmodifiableShortCollection
-
- org.eclipse.collections.impl.list.mutable.primitive.UnmodifiableShortList
-
- All Implemented Interfaces:
java.io.Serializable
,MutableShortCollection
,MutableShortList
,ShortList
,OrderedShortIterable
,ReversibleShortIterable
,PrimitiveIterable
,ShortIterable
public class UnmodifiableShortList extends AbstractUnmodifiableShortCollection implements MutableShortList
This file was automatically generated from template file unmodifiablePrimitiveList.stg.- Since:
- 3.1.
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private static long
serialVersionUID
-
Constructor Summary
Constructors Constructor Description UnmodifiableShortList(MutableShortList list)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
addAllAtIndex(int index, short... source)
boolean
addAllAtIndex(int index, ShortIterable source)
void
addAtIndex(int index, short element)
LazyShortIterable
asReversed()
MutableShortList
asSynchronized()
MutableShortList
asUnmodifiable()
int
binarySearch(short value)
<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.<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.<V,R extends java.util.Collection<V>>
RcollectWithIndex(ShortIntToObjectFunction<? extends V> function, R target)
Adds elements to the target Collection using results obtained by applying the specified function to each element and its corresponding index.MutableShortList
distinct()
long
dotProduct(ShortList list)
boolean
equals(java.lang.Object otherList)
Follows the same general contract asList.equals(Object)
.void
forEachWithIndex(ShortIntProcedure procedure)
short
get(int index)
short
getFirst()
short
getLast()
private MutableShortList
getMutableShortList()
int
hashCode()
Follows the same general contract asList.hashCode()
.int
indexOf(short value)
<T> T
injectIntoWithIndex(T injectedValue, ObjectShortIntToObjectFunction<? super T,? extends T> function)
int
lastIndexOf(short value)
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.MutableShortList
rejectWithIndex(ShortIntPredicate predicate)
Returns a new MutableShortList excluding all elements with corresponding indexes matching the specified predicate.<R extends MutableShortCollection>
RrejectWithIndex(ShortIntPredicate predicate, R target)
Returns a new MutableShortCollection 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.MutableShortList
selectWithIndex(ShortIntPredicate predicate)
Returns a new MutableShortList including all elements with corresponding indexes matching the specified predicate.<R extends MutableShortCollection>
RselectWithIndex(ShortIntPredicate predicate, R target)
Returns a new MutableShortCollection including all elements with corresponding indexes matching the specified predicate.short
set(int index, short element)
MutableShortList
shuffleThis()
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).MutableShortList
subList(int fromIndex, int toIndex)
ImmutableShortList
toImmutable()
Returns an immutable copy of this list.MutableShortList
toReversed()
UnmodifiableShortList
with(short element)
UnmodifiableShortList
withAll(ShortIterable elements)
UnmodifiableShortList
without(short element)
UnmodifiableShortList
withoutAll(ShortIterable elements)
<T> MutableList<ShortObjectPair<T>>
zip(java.lang.Iterable<T> iterable)
Returns aMutableList
formed from thisMutableShortList
and aListIterable
by combining corresponding elements in pairs.MutableList<ShortShortPair>
zipShort(ShortIterable iterable)
Returns aMutableList
formed from thisMutableShortList
and anotherShortList
by combining corresponding elements in pairs.-
Methods inherited from class org.eclipse.collections.impl.collection.mutable.primitive.AbstractUnmodifiableShortCollection
add, addAll, addAll, allSatisfy, anySatisfy, appendString, appendString, appendString, asLazy, average, chunk, clear, contains, containsAll, containsAll, containsAny, containsAny, containsNone, containsNone, count, detectIfNone, each, getShortCollection, injectInto, isEmpty, makeString, makeString, makeString, max, maxIfEmpty, median, min, minIfEmpty, noneSatisfy, notEmpty, reduce, reduceIfEmpty, remove, removeAll, removeAll, removeIf, retainAll, retainAll, shortIterator, size, sum, toArray, toArray, toBag, toList, toSet, toSortedArray, toSortedList, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
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.list.primitive.MutableShortList
shuffleThis, sortThis, sortThisBy, sortThisBy, swap, tap
-
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.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
forEachInBoth
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
UnmodifiableShortList
public UnmodifiableShortList(MutableShortList list)
-
-
Method Detail
-
getMutableShortList
private MutableShortList getMutableShortList()
-
getFirst
public short getFirst()
- Specified by:
getFirst
in interfaceOrderedShortIterable
-
getLast
public short getLast()
- Specified by:
getLast
in interfaceReversibleShortIterable
-
indexOf
public int indexOf(short value)
- Specified by:
indexOf
in interfaceOrderedShortIterable
-
lastIndexOf
public int lastIndexOf(short value)
- Specified by:
lastIndexOf
in interfaceShortList
-
addAtIndex
public void addAtIndex(int index, short element)
- Specified by:
addAtIndex
in interfaceMutableShortList
-
addAllAtIndex
public boolean addAllAtIndex(int index, short... source)
- Specified by:
addAllAtIndex
in interfaceMutableShortList
-
addAllAtIndex
public boolean addAllAtIndex(int index, ShortIterable source)
- Specified by:
addAllAtIndex
in interfaceMutableShortList
-
removeAtIndex
public short removeAtIndex(int index)
- Specified by:
removeAtIndex
in interfaceMutableShortList
-
set
public short set(int index, short element)
- Specified by:
set
in interfaceMutableShortList
-
with
public UnmodifiableShortList with(short element)
- Specified by:
with
in interfaceMutableShortCollection
- Specified by:
with
in interfaceMutableShortList
- Overrides:
with
in classAbstractUnmodifiableShortCollection
-
without
public UnmodifiableShortList without(short element)
- Specified by:
without
in interfaceMutableShortCollection
- Specified by:
without
in interfaceMutableShortList
- Overrides:
without
in classAbstractUnmodifiableShortCollection
-
withAll
public UnmodifiableShortList withAll(ShortIterable elements)
- Specified by:
withAll
in interfaceMutableShortCollection
- Specified by:
withAll
in interfaceMutableShortList
- Overrides:
withAll
in classAbstractUnmodifiableShortCollection
-
withoutAll
public UnmodifiableShortList withoutAll(ShortIterable elements)
- Specified by:
withoutAll
in interfaceMutableShortCollection
- Specified by:
withoutAll
in interfaceMutableShortList
- Overrides:
withoutAll
in classAbstractUnmodifiableShortCollection
-
select
public 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 interfaceMutableShortList
- Specified by:
select
in interfaceOrderedShortIterable
- Specified by:
select
in interfaceReversibleShortIterable
- Specified by:
select
in interfaceShortIterable
- Specified by:
select
in interfaceShortList
- Overrides:
select
in classAbstractUnmodifiableShortCollection
-
reject
public 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 interfaceMutableShortList
- Specified by:
reject
in interfaceOrderedShortIterable
- Specified by:
reject
in interfaceReversibleShortIterable
- Specified by:
reject
in interfaceShortIterable
- Specified by:
reject
in interfaceShortList
- Overrides:
reject
in classAbstractUnmodifiableShortCollection
-
collect
public <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 interfaceMutableShortList
- Specified by:
collect
in interfaceOrderedShortIterable
- Specified by:
collect
in interfaceReversibleShortIterable
- Specified by:
collect
in interfaceShortIterable
- Specified by:
collect
in interfaceShortList
- Overrides:
collect
in classAbstractUnmodifiableShortCollection
-
sortThis
public MutableShortList sortThis()
Description copied from interface:MutableShortList
Sorts this list mutating its contents and returns the same mutable list (this).- Specified by:
sortThis
in interfaceMutableShortList
-
shuffleThis
public MutableShortList shuffleThis()
Description copied from interface:MutableShortList
Randomly permutes this list mutating its contents and returns the same list (this). Usesjava.util.Random
as the source of randomness.- Specified by:
shuffleThis
in interfaceMutableShortList
-
binarySearch
public int binarySearch(short value)
- Specified by:
binarySearch
in interfaceShortList
-
dotProduct
public long dotProduct(ShortList list)
- Specified by:
dotProduct
in interfaceShortList
-
equals
public boolean equals(java.lang.Object otherList)
Description copied from interface:ShortList
Follows the same general contract asList.equals(Object)
.
-
hashCode
public int hashCode()
Description copied from interface:ShortList
Follows the same general contract asList.hashCode()
.
-
asUnmodifiable
public MutableShortList asUnmodifiable()
- Specified by:
asUnmodifiable
in interfaceMutableShortCollection
- Specified by:
asUnmodifiable
in interfaceMutableShortList
- Overrides:
asUnmodifiable
in classAbstractUnmodifiableShortCollection
-
asSynchronized
public MutableShortList asSynchronized()
- Specified by:
asSynchronized
in interfaceMutableShortCollection
- Specified by:
asSynchronized
in interfaceMutableShortList
- Overrides:
asSynchronized
in classAbstractUnmodifiableShortCollection
-
toImmutable
public ImmutableShortList toImmutable()
Description copied from interface:MutableShortList
Returns an immutable copy of this list.- Specified by:
toImmutable
in interfaceMutableShortCollection
- Specified by:
toImmutable
in interfaceMutableShortList
- Specified by:
toImmutable
in interfaceShortList
- Overrides:
toImmutable
in classAbstractUnmodifiableShortCollection
-
newEmpty
public MutableShortList newEmpty()
Description copied from interface:MutableShortList
Creates a new empty mutable version of the same List type.- Specified by:
newEmpty
in interfaceMutableShortCollection
- Specified by:
newEmpty
in interfaceMutableShortList
- Since:
- 9.2.
-
reverseThis
public MutableShortList reverseThis()
- Specified by:
reverseThis
in interfaceMutableShortList
-
toReversed
public MutableShortList toReversed()
- Specified by:
toReversed
in interfaceMutableShortList
- Specified by:
toReversed
in interfaceReversibleShortIterable
- Specified by:
toReversed
in interfaceShortList
-
forEachWithIndex
public void forEachWithIndex(ShortIntProcedure procedure)
- Specified by:
forEachWithIndex
in interfaceOrderedShortIterable
-
asReversed
public LazyShortIterable asReversed()
- Specified by:
asReversed
in interfaceReversibleShortIterable
-
injectIntoWithIndex
public <T> T injectIntoWithIndex(T injectedValue, ObjectShortIntToObjectFunction<? super T,? extends T> function)
- Specified by:
injectIntoWithIndex
in interfaceOrderedShortIterable
- Specified by:
injectIntoWithIndex
in interfaceReversibleShortIterable
-
distinct
public MutableShortList distinct()
- Specified by:
distinct
in interfaceMutableShortList
- Specified by:
distinct
in interfaceReversibleShortIterable
- Specified by:
distinct
in interfaceShortList
- Since:
- 6.0.
-
subList
public MutableShortList subList(int fromIndex, int toIndex)
- Specified by:
subList
in interfaceMutableShortList
- Specified by:
subList
in interfaceShortList
- See Also:
List.subList(int fromIndex, int toIndex)
-
zipShort
public MutableList<ShortShortPair> zipShort(ShortIterable iterable)
Description copied from interface:MutableShortList
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.- Specified by:
zipShort
in interfaceMutableShortList
- Specified by:
zipShort
in interfaceShortList
- Since:
- 9.1.
-
zip
public <T> MutableList<ShortObjectPair<T>> zip(java.lang.Iterable<T> iterable)
Description copied from interface:MutableShortList
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.- Specified by:
zip
in interfaceMutableShortList
- Specified by:
zip
in interfaceShortList
- Since:
- 9.1.
-
selectWithIndex
public MutableShortList selectWithIndex(ShortIntPredicate predicate)
Returns a new MutableShortList including all elements with corresponding indexes matching the specified predicate.- Specified by:
selectWithIndex
in interfaceMutableShortList
- Specified by:
selectWithIndex
in interfaceOrderedShortIterable
- Specified by:
selectWithIndex
in interfaceReversibleShortIterable
- Specified by:
selectWithIndex
in interfaceShortList
- Since:
- 11.1.
-
selectWithIndex
public <R extends MutableShortCollection> R selectWithIndex(ShortIntPredicate predicate, R target)
Returns a new MutableShortCollection including all elements with corresponding indexes matching the specified predicate.- Specified by:
selectWithIndex
in interfaceOrderedShortIterable
- Since:
- 11.1.
-
rejectWithIndex
public MutableShortList rejectWithIndex(ShortIntPredicate predicate)
Returns a new MutableShortList excluding all elements with corresponding indexes matching the specified predicate.- Specified by:
rejectWithIndex
in interfaceMutableShortList
- Specified by:
rejectWithIndex
in interfaceOrderedShortIterable
- Specified by:
rejectWithIndex
in interfaceReversibleShortIterable
- Specified by:
rejectWithIndex
in interfaceShortList
- Since:
- 11.1.
-
rejectWithIndex
public <R extends MutableShortCollection> R rejectWithIndex(ShortIntPredicate predicate, R target)
Returns a new MutableShortCollection excluding all elements with corresponding indexes matching the specified predicate.- Specified by:
rejectWithIndex
in interfaceOrderedShortIterable
- Since:
- 11.1.
-
collectWithIndex
public <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 interfaceMutableShortList
- Specified by:
collectWithIndex
in interfaceOrderedShortIterable
- Specified by:
collectWithIndex
in interfaceReversibleShortIterable
- Specified by:
collectWithIndex
in interfaceShortList
- Since:
- 9.1.
-
collectWithIndex
public <V,R extends java.util.Collection<V>> R collectWithIndex(ShortIntToObjectFunction<? extends V> function, R target)
Adds elements to the target Collection using results obtained by applying the specified function to each element and its corresponding index.- Specified by:
collectWithIndex
in interfaceOrderedShortIterable
- Since:
- 9.1.
-
-