@NotThreadSafe 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 and Description |
---|
ShortArrayList() |
ShortArrayList(int initialCapacity) |
ShortArrayList(short... array) |
Modifier and Type | Method and 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) |
boolean |
anySatisfy(ShortPredicate predicate) |
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) |
void |
clear() |
<V> MutableList<V> |
collect(ShortToObjectFunction<? extends V> function) |
boolean |
contains(short value) |
int |
count(ShortPredicate predicate) |
short |
detectIfNone(ShortPredicate predicate,
short ifNone) |
MutableShortList |
distinct() |
long |
dotProduct(ShortList list) |
void |
each(ShortProcedure procedure) |
void |
ensureCapacity(int minCapacity) |
boolean |
equals(Object otherList)
Follows the same general contract as
List.equals(Object) . |
void |
forEach(ShortProcedure procedure) |
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() |
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) |
void |
readExternal(ObjectInput in) |
ShortArrayList |
reject(ShortPredicate predicate) |
boolean |
remove(short value) |
boolean |
removeAll(short... source) |
boolean |
removeAll(ShortIterable source) |
short |
removeAtIndex(int index) |
boolean |
retainAll(short... source) |
boolean |
retainAll(ShortIterable source) |
ShortArrayList |
reverseThis() |
ShortArrayList |
select(ShortPredicate predicate) |
short |
set(int index,
short element) |
MutableShortIterator |
shortIterator() |
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() |
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) |
asLazy, average, containsAll, containsAll, maxIfEmpty, median, minIfEmpty, toBag, toList, toSet, toSortedArray, toSortedList, toString
asLazy, average, containsAll, containsAll, maxIfEmpty, median, minIfEmpty, summaryStatistics, toBag, toList, toSet, toSortedArray, toSortedList
appendString, appendString, isEmpty, makeString, makeString, makeString, notEmpty, toString
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)
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 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()
shortIterator
in interface MutableShortCollection
shortIterator
in interface ShortIterable
public void forEach(ShortProcedure procedure)
forEach
in interface ShortIterable
public void each(ShortProcedure procedure)
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 int count(ShortPredicate predicate)
count
in interface ShortIterable
public boolean anySatisfy(ShortPredicate predicate)
anySatisfy
in interface ShortIterable
public boolean allSatisfy(ShortPredicate predicate)
allSatisfy
in interface ShortIterable
public boolean noneSatisfy(ShortPredicate predicate)
noneSatisfy
in interface ShortIterable
public ShortArrayList select(ShortPredicate predicate)
select
in interface MutableShortCollection
select
in interface MutableShortList
select
in interface ShortList
select
in interface OrderedShortIterable
select
in interface ReversibleShortIterable
select
in interface ShortIterable
public ShortArrayList reject(ShortPredicate predicate)
reject
in interface MutableShortCollection
reject
in interface MutableShortList
reject
in interface ShortList
reject
in interface OrderedShortIterable
reject
in interface ReversibleShortIterable
reject
in interface ShortIterable
public short detectIfNone(ShortPredicate predicate, short ifNone)
detectIfNone
in interface ShortIterable
public <V> MutableList<V> collect(ShortToObjectFunction<? extends V> function)
collect
in interface MutableShortCollection
collect
in interface MutableShortList
collect
in interface ShortList
collect
in interface OrderedShortIterable
collect
in interface ReversibleShortIterable
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()
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 ShortList
toReversed
in interface ReversibleShortIterable
public int binarySearch(short value)
binarySearch
in interface ShortList
public MutableShortList distinct()
distinct
in interface MutableShortList
distinct
in interface ShortList
distinct
in interface ReversibleShortIterable
public MutableShortList subList(int fromIndex, int toIndex)
subList
in interface MutableShortList
subList
in interface ShortList
List#subList(int fromIndex, int toIndex)}
Copyright © 2004–2016. All rights reserved.