Externalizable
, Serializable
, MutableShortCollection
, MutableShortList
, ShortList
, OrderedShortIterable
, ReversibleShortIterable
, PrimitiveIterable
, ShortIterable
public class ShortArrayList extends AbstractShortIterable implements MutableShortList, Externalizable
FastList
, and is memory-optimized for short primitives.
This file was automatically generated from template file primitiveArrayList.stg.Constructor | Description |
---|---|
ShortArrayList() |
|
ShortArrayList(int initialCapacity) |
|
ShortArrayList(short... array) |
Modifier and Type | Method | Description |
---|---|---|
boolean |
add(short newItem) |
|
boolean |
addAll(short... source) |
|
boolean |
addAll(ShortIterable source) |
|
boolean |
addAllAtIndex(int index,
short... source) |
|
boolean |
addAllAtIndex(int index,
ShortIterable source) |
|
void |
addAtIndex(int index,
short element) |
|
boolean |
allSatisfy(ShortPredicate predicate) |
Returns true if all of the elements in the ShortIterable return true for the
specified predicate, otherwise returns false.
|
boolean |
anySatisfy(ShortPredicate predicate) |
Returns true if any of the elements in the ShortIterable return true for the
specified predicate, otherwise returns false.
|
void |
appendString(Appendable appendable,
String start,
String separator,
String end) |
Prints a string representation of this collection onto the given
Appendable . |
LazyShortIterable |
asReversed() |
|
MutableShortList |
asSynchronized() |
|
MutableShortList |
asUnmodifiable() |
|
int |
binarySearch(short value) |
|
RichIterable<ShortIterable> |
chunk(int size) |
Partitions elements in fixed size chunks.
|
void |
clear() |
|
<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,R extends Collection<V>> |
collect(ShortToObjectFunction<? extends V> function,
R target) |
Same as
ShortIterable.collect(ShortToObjectFunction) , only the results are added to the target Collection. |
boolean |
contains(short value) |
Returns true if the value is contained in the ShortIterable, and false if it is not.
|
int |
count(ShortPredicate predicate) |
Returns a count of the number of elements in the ShortIterable that return true for the
specified predicate.
|
short |
detectIfNone(ShortPredicate predicate,
short ifNone) |
|
MutableShortList |
distinct() |
|
long |
dotProduct(ShortList list) |
|
void |
each(ShortProcedure procedure) |
A synonym for forEach.
|
void |
ensureCapacity(int minCapacity) |
|
boolean |
equals(Object otherList) |
Follows the same general contract as
List.equals(Object) . |
void |
forEach(ShortProcedure procedure) |
Applies the ShortProcedure to each element in the ShortIterable.
|
void |
forEachWithIndex(ShortIntProcedure procedure) |
|
short |
get(int index) |
|
short |
getFirst() |
|
short |
getLast() |
|
int |
hashCode() |
Follows the same general contract as
List.hashCode() . |
int |
indexOf(short value) |
|
<T> T |
injectInto(T injectedValue,
ObjectShortToObjectFunction<? super T,? extends T> function) |
|
<T> T |
injectIntoWithIndex(T injectedValue,
ObjectShortIntToObjectFunction<? super T,? extends T> function) |
|
int |
lastIndexOf(short value) |
|
short |
max() |
|
short |
min() |
|
ShortArrayList |
newEmpty() |
Creates a new empty ShortArrayList.
|
static ShortArrayList |
newList(ShortIterable source) |
|
static ShortArrayList |
newListWith(short... elements) |
Creates a new list using the passed
elements argument as the backing store. |
static ShortArrayList |
newWithNValues(int size,
short value) |
|
boolean |
noneSatisfy(ShortPredicate predicate) |
Returns true if none of the elements in the ShortIterable return true for the
specified predicate, otherwise returns false.
|
void |
readExternal(ObjectInput in) |
|
ShortArrayList |
reject(ShortPredicate predicate) |
Returns a new ShortIterable with all of the elements in the ShortIterable that
return false for the specified predicate.
|
<R extends MutableShortCollection> |
reject(ShortPredicate predicate,
R target) |
Same as
ShortIterable.reject(ShortPredicate) , only the results are added to the target MutableShortCollection. |
boolean |
remove(short value) |
|
boolean |
removeAll(short... source) |
|
boolean |
removeAll(ShortIterable source) |
|
short |
removeAtIndex(int index) |
|
boolean |
removeIf(ShortPredicate predicate) |
|
boolean |
retainAll(short... source) |
|
boolean |
retainAll(ShortIterable source) |
|
ShortArrayList |
reverseThis() |
|
ShortArrayList |
select(ShortPredicate predicate) |
Returns a new ShortIterable with all of the elements in the ShortIterable that
return true for the specified predicate.
|
<R extends MutableShortCollection> |
select(ShortPredicate predicate,
R target) |
Same as
ShortIterable.select(ShortPredicate) , only the results are added to the target MutableShortCollection. |
short |
set(int index,
short element) |
|
MutableShortIterator |
shortIterator() |
Returns a primitive iterator that can be used to iterate over the ShortIterable in an
imperative style.
|
int |
size() |
Returns the number of items in this iterable.
|
ShortArrayList |
sortThis() |
Sorts this list mutating its contents and returns the same mutable list (this).
|
MutableShortList |
subList(int fromIndex,
int toIndex) |
|
long |
sum() |
|
short[] |
toArray() |
Converts the ShortIterable to a primitive short array.
|
ImmutableShortList |
toImmutable() |
Returns an immutable copy of this list.
|
ShortArrayList |
toReversed() |
|
void |
trimToSize() |
|
ShortArrayList |
with(short element) |
|
ShortArrayList |
with(short element1,
short element2) |
|
ShortArrayList |
with(short element1,
short element2,
short element3) |
|
ShortArrayList |
with(short element1,
short element2,
short element3,
short... elements) |
|
ShortArrayList |
withAll(ShortIterable elements) |
|
ShortArrayList |
without(short element) |
|
ShortArrayList |
withoutAll(ShortIterable elements) |
|
void |
writeExternal(ObjectOutput out) |
|
<T> MutableList<ShortObjectPair<T>> |
zip(Iterable<T> iterable) |
Returns a
MutableList formed from this MutableShortList and a ListIterable by
combining corresponding elements in pairs. |
MutableList<ShortShortPair> |
zipShort(ShortIterable iterable) |
Returns a
MutableList formed from this MutableShortList and another ShortList by
combining corresponding elements in pairs. |
asLazy, average, containsAll, containsAll, maxIfEmpty, median, minIfEmpty, toBag, toList, toSet, toSortedArray, toSortedList, toString
collectWithIndex, tap
collectWithIndex
appendString, appendString, isEmpty, makeString, makeString, makeString, notEmpty, toString
asLazy, average, averageIfEmpty, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectInt, collectLong, collectShort, containsAll, containsAll, flatCollect, maxIfEmpty, median, medianIfEmpty, minIfEmpty, reduce, reduceIfEmpty, summaryStatistics, toBag, toList, toSet, toSortedArray, toSortedList
public ShortArrayList()
public ShortArrayList(int initialCapacity)
public ShortArrayList(short... array)
public static ShortArrayList newListWith(short... elements)
elements
argument as the backing store.
!!! WARNING: This method uses the passed in array, so can be very unsafe if the original array is held onto anywhere else. !!!
public static ShortArrayList newList(ShortIterable source)
public static ShortArrayList newWithNValues(int size, short value)
public int size()
PrimitiveIterable
size
in interface PrimitiveIterable
public void clear()
clear
in interface MutableShortCollection
public boolean contains(short value)
ShortIterable
contains
in interface ShortIterable
public short getFirst()
getFirst
in interface OrderedShortIterable
public short getLast()
getLast
in interface ReversibleShortIterable
public int indexOf(short value)
indexOf
in interface OrderedShortIterable
public int lastIndexOf(short value)
lastIndexOf
in interface ShortList
public void trimToSize()
public void ensureCapacity(int minCapacity)
public boolean add(short newItem)
add
in interface MutableShortCollection
public boolean addAll(short... source)
addAll
in interface MutableShortCollection
public boolean addAll(ShortIterable source)
addAll
in interface MutableShortCollection
public void addAtIndex(int index, short element)
addAtIndex
in interface MutableShortList
public boolean addAllAtIndex(int index, short... source)
addAllAtIndex
in interface MutableShortList
public boolean addAllAtIndex(int index, ShortIterable source)
addAllAtIndex
in interface MutableShortList
public boolean remove(short value)
remove
in interface MutableShortCollection
public boolean removeIf(ShortPredicate predicate)
removeIf
in interface MutableShortCollection
public boolean removeAll(ShortIterable source)
removeAll
in interface MutableShortCollection
public boolean removeAll(short... source)
removeAll
in interface MutableShortCollection
public boolean retainAll(ShortIterable source)
retainAll
in interface MutableShortCollection
Collection.retainAll(Collection)
public boolean retainAll(short... source)
retainAll
in interface MutableShortCollection
Collection.retainAll(Collection)
public short removeAtIndex(int index)
removeAtIndex
in interface MutableShortList
public short set(int index, short element)
set
in interface MutableShortList
public ShortArrayList with(short element)
with
in interface MutableShortCollection
with
in interface MutableShortList
public ShortArrayList without(short element)
without
in interface MutableShortCollection
without
in interface MutableShortList
public ShortArrayList withAll(ShortIterable elements)
withAll
in interface MutableShortCollection
withAll
in interface MutableShortList
public ShortArrayList withoutAll(ShortIterable elements)
withoutAll
in interface MutableShortCollection
withoutAll
in interface MutableShortList
public ShortArrayList with(short element1, short element2)
public ShortArrayList with(short element1, short element2, short element3)
public ShortArrayList with(short element1, short element2, short element3, short... elements)
public MutableShortIterator shortIterator()
ShortIterable
shortIterator
in interface MutableShortCollection
shortIterator
in interface ShortIterable
public void forEach(ShortProcedure procedure)
ShortIterable
forEach
in interface ShortIterable
public void each(ShortProcedure procedure)
ShortIterable
each
in interface ShortIterable
public void forEachWithIndex(ShortIntProcedure procedure)
forEachWithIndex
in interface OrderedShortIterable
public <T> T injectInto(T injectedValue, ObjectShortToObjectFunction<? super T,? extends T> function)
injectInto
in interface ShortIterable
public <T> T injectIntoWithIndex(T injectedValue, ObjectShortIntToObjectFunction<? super T,? extends T> function)
injectIntoWithIndex
in interface OrderedShortIterable
injectIntoWithIndex
in interface ReversibleShortIterable
public RichIterable<ShortIterable> chunk(int size)
ShortIterable
chunk
in interface ShortIterable
size
- the number of elements per chunkRichIterable
containing ShortIterable
s of size size
, except the last will be
truncated if the elements don't divide evenly.public int count(ShortPredicate predicate)
ShortIterable
count
in interface ShortIterable
public boolean anySatisfy(ShortPredicate predicate)
ShortIterable
anySatisfy
in interface ShortIterable
public boolean allSatisfy(ShortPredicate predicate)
ShortIterable
allSatisfy
in interface ShortIterable
public boolean noneSatisfy(ShortPredicate predicate)
ShortIterable
noneSatisfy
in interface ShortIterable
public ShortArrayList select(ShortPredicate predicate)
ShortIterable
select
in interface MutableShortCollection
select
in interface MutableShortList
select
in interface OrderedShortIterable
select
in interface ReversibleShortIterable
select
in interface ShortIterable
select
in interface ShortList
public <R extends MutableShortCollection> R select(ShortPredicate predicate, R target)
ShortIterable
ShortIterable.select(ShortPredicate)
, only the results are added to the target MutableShortCollection.select
in interface ShortIterable
public ShortArrayList reject(ShortPredicate predicate)
ShortIterable
reject
in interface MutableShortCollection
reject
in interface MutableShortList
reject
in interface OrderedShortIterable
reject
in interface ReversibleShortIterable
reject
in interface ShortIterable
reject
in interface ShortList
public <R extends MutableShortCollection> R reject(ShortPredicate predicate, R target)
ShortIterable
ShortIterable.reject(ShortPredicate)
, only the results are added to the target MutableShortCollection.reject
in interface ShortIterable
public short detectIfNone(ShortPredicate predicate, short ifNone)
detectIfNone
in interface ShortIterable
public <V> MutableList<V> collect(ShortToObjectFunction<? extends V> function)
ShortIterable
collect
in interface MutableShortCollection
collect
in interface MutableShortList
collect
in interface OrderedShortIterable
collect
in interface ReversibleShortIterable
collect
in interface ShortIterable
collect
in interface ShortList
public <V,R extends Collection<V>> R collect(ShortToObjectFunction<? extends V> function, R target)
ShortIterable
ShortIterable.collect(ShortToObjectFunction)
, only the results are added to the target Collection.collect
in interface ShortIterable
public short max()
max
in interface ShortIterable
public short min()
min
in interface ShortIterable
public long sum()
sum
in interface ShortIterable
public long dotProduct(ShortList list)
dotProduct
in interface ShortList
public short[] toArray()
ShortIterable
toArray
in interface ShortIterable
public boolean equals(Object otherList)
ShortList
List.equals(Object)
.public int hashCode()
ShortList
List.hashCode()
.public void appendString(Appendable appendable, String start, String separator, String end)
PrimitiveIterable
Appendable
. Prints the string returned
by PrimitiveIterable.makeString(String, String, String)
.appendString
in interface PrimitiveIterable
public MutableShortList asUnmodifiable()
asUnmodifiable
in interface MutableShortCollection
asUnmodifiable
in interface MutableShortList
public MutableShortList asSynchronized()
asSynchronized
in interface MutableShortCollection
asSynchronized
in interface MutableShortList
public ImmutableShortList toImmutable()
MutableShortList
toImmutable
in interface MutableShortCollection
toImmutable
in interface MutableShortList
toImmutable
in interface ShortList
public void writeExternal(ObjectOutput out) throws IOException
writeExternal
in interface Externalizable
IOException
public void readExternal(ObjectInput in) throws IOException
readExternal
in interface Externalizable
IOException
public LazyShortIterable asReversed()
asReversed
in interface ReversibleShortIterable
public ShortArrayList reverseThis()
reverseThis
in interface MutableShortList
public ShortArrayList sortThis()
MutableShortList
sortThis
in interface MutableShortList
public ShortArrayList toReversed()
toReversed
in interface MutableShortList
toReversed
in interface ReversibleShortIterable
toReversed
in interface ShortList
public int binarySearch(short value)
binarySearch
in interface ShortList
public MutableShortList distinct()
distinct
in interface MutableShortList
distinct
in interface ReversibleShortIterable
distinct
in interface ShortList
public MutableShortList subList(int fromIndex, int toIndex)
subList
in interface MutableShortList
subList
in interface ShortList
List.subList(int fromIndex, int toIndex)
public MutableList<ShortShortPair> zipShort(ShortIterable iterable)
MutableShortList
MutableList
formed from this MutableShortList
and another ShortList
by
combining corresponding elements in pairs. If one of the two ShortList
s is longer than the other, its
remaining elements are ignored.zipShort
in interface MutableShortList
zipShort
in interface ShortList
public ShortArrayList newEmpty()
newEmpty
in interface MutableShortCollection
newEmpty
in interface MutableShortList
public <T> MutableList<ShortObjectPair<T>> zip(Iterable<T> iterable)
MutableShortList
MutableList
formed from this MutableShortList
and a ListIterable
by
combining corresponding elements in pairs. If one of the two Lists is longer than the other, its
remaining elements are ignored.zip
in interface MutableShortList
zip
in interface ShortList
Copyright © 2004–2019. All rights reserved.