@NotThreadSafe public final class ShortArrayList extends Object 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)
Prints a string representation of this collection onto the given
Appendable . |
void |
appendString(Appendable appendable,
String separator)
Prints a string representation of this collection onto the given
Appendable . |
void |
appendString(Appendable appendable,
String start,
String separator,
String end)
Prints a string representation of this collection onto the given
Appendable . |
LazyShortIterable |
asLazy() |
LazyShortIterable |
asReversed() |
MutableShortList |
asSynchronized() |
MutableShortList |
asUnmodifiable() |
double |
average() |
void |
clear() |
<V> MutableList<V> |
collect(ShortToObjectFunction<? extends V> function) |
boolean |
contains(short value) |
boolean |
containsAll(short... source) |
boolean |
containsAll(ShortIterable source) |
int |
count(ShortPredicate predicate) |
short |
detectIfNone(ShortPredicate predicate,
short ifNone) |
long |
dotProduct(ShortList list) |
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) |
boolean |
isEmpty()
Returns true if this iterable has zero items.
|
int |
lastIndexOf(short value) |
String |
makeString()
Returns a string representation of this collection by delegating to
PrimitiveIterable.makeString(String) and defaulting
the separator parameter to the characters ", " (comma and space). |
String |
makeString(String separator)
Returns a string representation of this collection by delegating to
PrimitiveIterable.makeString(String, String, String)
and defaulting the start and end parameters to "" (the empty String). |
String |
makeString(String start,
String separator,
String end)
Returns a string representation of this collection.
|
short |
max() |
short |
maxIfEmpty(short defaultValue) |
double |
median() |
short |
min() |
short |
minIfEmpty(short defaultValue) |
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) |
boolean |
notEmpty()
The English equivalent of !this.isEmpty()
|
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) |
ShortIterator |
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() |
MutableShortBag |
toBag() |
ImmutableShortList |
toImmutable()
Returns an immutable copy of this list.
|
MutableShortList |
toList() |
ShortArrayList |
toReversed() |
MutableShortSet |
toSet() |
short[] |
toSortedArray() |
MutableShortList |
toSortedList() |
String |
toString()
Returns a string representation of this PrimitiveIterable.
|
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) |
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 boolean isEmpty()
PrimitiveIterable
isEmpty
in interface PrimitiveIterable
public boolean notEmpty()
PrimitiveIterable
notEmpty
in interface PrimitiveIterable
public void clear()
clear
in interface MutableShortCollection
public boolean contains(short value)
contains
in interface ShortIterable
public boolean containsAll(short... source)
containsAll
in interface ShortIterable
public boolean containsAll(ShortIterable source)
containsAll
in interface ShortIterable
public short getFirst()
getFirst
in interface ReversibleShortIterable
public short getLast()
getLast
in interface ReversibleShortIterable
public int indexOf(short value)
indexOf
in interface ReversibleShortIterable
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 ShortIterator shortIterator()
shortIterator
in interface ShortIterable
public void forEach(ShortProcedure procedure)
forEach
in interface ShortIterable
public void forEachWithIndex(ShortIntProcedure procedure)
forEachWithIndex
in interface ReversibleShortIterable
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 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 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 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 ReversibleShortIterable
collect
in interface ShortIterable
public short max()
max
in interface ShortIterable
public short min()
min
in interface ShortIterable
public short minIfEmpty(short defaultValue)
minIfEmpty
in interface ShortIterable
public short maxIfEmpty(short defaultValue)
maxIfEmpty
in interface ShortIterable
public long sum()
sum
in interface ShortIterable
public long dotProduct(ShortList list)
dotProduct
in interface ShortList
public double average()
average
in interface ShortIterable
public double median()
median
in interface ShortIterable
public short[] toArray()
toArray
in interface ShortIterable
public short[] toSortedArray()
toSortedArray
in interface ShortIterable
public boolean equals(Object otherList)
ShortList
List.equals(Object)
.public int hashCode()
ShortList
List.hashCode()
.public String toString()
PrimitiveIterable
toString
in interface PrimitiveIterable
toString
in class Object
public String makeString()
PrimitiveIterable
PrimitiveIterable.makeString(String)
and defaulting
the separator parameter to the characters ", " (comma and space).makeString
in interface PrimitiveIterable
public String makeString(String separator)
PrimitiveIterable
PrimitiveIterable.makeString(String, String, String)
and defaulting the start and end parameters to "" (the empty String).makeString
in interface PrimitiveIterable
public String makeString(String start, String separator, String end)
PrimitiveIterable
makeString
in interface PrimitiveIterable
public void appendString(Appendable appendable)
PrimitiveIterable
Appendable
. Prints the string returned
by PrimitiveIterable.makeString()
.appendString
in interface PrimitiveIterable
public void appendString(Appendable appendable, String separator)
PrimitiveIterable
Appendable
. Prints the string returned
by PrimitiveIterable.makeString(String)
.appendString
in interface PrimitiveIterable
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 toList()
toList
in interface ShortIterable
public MutableShortList toSortedList()
toSortedList
in interface ShortIterable
public MutableShortSet toSet()
toSet
in interface ShortIterable
public MutableShortBag toBag()
toBag
in interface ShortIterable
public LazyShortIterable asLazy()
asLazy
in interface ShortIterable
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 MutableShortList subList(int fromIndex, int toIndex)
subList
in interface MutableShortList
subList
in interface ShortList
List#subList(int fromIndex, int toIndex)}
Copyright © 2004–2018. All rights reserved.