@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()
PrimitiveIterablesize in interface PrimitiveIterablepublic boolean isEmpty()
PrimitiveIterableisEmpty in interface PrimitiveIterablepublic boolean notEmpty()
PrimitiveIterablenotEmpty in interface PrimitiveIterablepublic void clear()
clear in interface MutableShortCollectionpublic boolean contains(short value)
contains in interface ShortIterablepublic boolean containsAll(short... source)
containsAll in interface ShortIterablepublic boolean containsAll(ShortIterable source)
containsAll in interface ShortIterablepublic short getFirst()
getFirst in interface ReversibleShortIterablepublic short getLast()
getLast in interface ReversibleShortIterablepublic int indexOf(short value)
indexOf in interface ReversibleShortIterablepublic int lastIndexOf(short value)
lastIndexOf in interface ShortListpublic void trimToSize()
public void ensureCapacity(int minCapacity)
public boolean add(short newItem)
add in interface MutableShortCollectionpublic boolean addAll(short... source)
addAll in interface MutableShortCollectionpublic boolean addAll(ShortIterable source)
addAll in interface MutableShortCollectionpublic void addAtIndex(int index,
short element)
addAtIndex in interface MutableShortListpublic boolean addAllAtIndex(int index,
short... source)
addAllAtIndex in interface MutableShortListpublic boolean addAllAtIndex(int index,
ShortIterable source)
addAllAtIndex in interface MutableShortListpublic boolean remove(short value)
remove in interface MutableShortCollectionpublic boolean removeAll(ShortIterable source)
removeAll in interface MutableShortCollectionpublic boolean removeAll(short... source)
removeAll in interface MutableShortCollectionpublic boolean retainAll(ShortIterable source)
retainAll in interface MutableShortCollectionCollection.retainAll(Collection)public boolean retainAll(short... source)
retainAll in interface MutableShortCollectionCollection.retainAll(Collection)public short removeAtIndex(int index)
removeAtIndex in interface MutableShortListpublic short set(int index,
short element)
set in interface MutableShortListpublic ShortArrayList with(short element)
with in interface MutableShortCollectionwith in interface MutableShortListpublic ShortArrayList without(short element)
without in interface MutableShortCollectionwithout in interface MutableShortListpublic ShortArrayList withAll(ShortIterable elements)
withAll in interface MutableShortCollectionwithAll in interface MutableShortListpublic ShortArrayList withoutAll(ShortIterable elements)
withoutAll in interface MutableShortCollectionwithoutAll in interface MutableShortListpublic 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 ShortIterablepublic void forEach(ShortProcedure procedure)
forEach in interface ShortIterablepublic void forEachWithIndex(ShortIntProcedure procedure)
forEachWithIndex in interface ReversibleShortIterablepublic <T> T injectInto(T injectedValue,
ObjectShortToObjectFunction<? super T,? extends T> function)
injectInto in interface ShortIterablepublic <T> T injectIntoWithIndex(T injectedValue,
ObjectShortIntToObjectFunction<? super T,? extends T> function)
injectIntoWithIndex in interface ReversibleShortIterablepublic int count(ShortPredicate predicate)
count in interface ShortIterablepublic boolean anySatisfy(ShortPredicate predicate)
anySatisfy in interface ShortIterablepublic boolean allSatisfy(ShortPredicate predicate)
allSatisfy in interface ShortIterablepublic boolean noneSatisfy(ShortPredicate predicate)
noneSatisfy in interface ShortIterablepublic ShortArrayList select(ShortPredicate predicate)
select in interface MutableShortCollectionselect in interface MutableShortListselect in interface ShortListselect in interface ReversibleShortIterableselect in interface ShortIterablepublic ShortArrayList reject(ShortPredicate predicate)
reject in interface MutableShortCollectionreject in interface MutableShortListreject in interface ShortListreject in interface ReversibleShortIterablereject in interface ShortIterablepublic short detectIfNone(ShortPredicate predicate, short ifNone)
detectIfNone in interface ShortIterablepublic <V> MutableList<V> collect(ShortToObjectFunction<? extends V> function)
collect in interface MutableShortCollectioncollect in interface MutableShortListcollect in interface ShortListcollect in interface ReversibleShortIterablecollect in interface ShortIterablepublic short max()
max in interface ShortIterablepublic short min()
min in interface ShortIterablepublic short minIfEmpty(short defaultValue)
minIfEmpty in interface ShortIterablepublic short maxIfEmpty(short defaultValue)
maxIfEmpty in interface ShortIterablepublic long sum()
sum in interface ShortIterablepublic long dotProduct(ShortList list)
dotProduct in interface ShortListpublic double average()
average in interface ShortIterablepublic double median()
median in interface ShortIterablepublic short[] toArray()
toArray in interface ShortIterablepublic short[] toSortedArray()
toSortedArray in interface ShortIterablepublic boolean equals(Object otherList)
ShortListList.equals(Object).public int hashCode()
ShortListList.hashCode().public String toString()
PrimitiveIterabletoString in interface PrimitiveIterabletoString in class Objectpublic String makeString()
PrimitiveIterablePrimitiveIterable.makeString(String) and defaulting
the separator parameter to the characters ", " (comma and space).makeString in interface PrimitiveIterablepublic String makeString(String separator)
PrimitiveIterablePrimitiveIterable.makeString(String, String, String)
and defaulting the start and end parameters to "" (the empty String).makeString in interface PrimitiveIterablepublic String makeString(String start, String separator, String end)
PrimitiveIterablemakeString in interface PrimitiveIterablepublic void appendString(Appendable appendable)
PrimitiveIterableAppendable. Prints the string returned
by PrimitiveIterable.makeString().appendString in interface PrimitiveIterablepublic void appendString(Appendable appendable, String separator)
PrimitiveIterableAppendable. Prints the string returned
by PrimitiveIterable.makeString(String).appendString in interface PrimitiveIterablepublic void appendString(Appendable appendable, String start, String separator, String end)
PrimitiveIterableAppendable. Prints the string returned
by PrimitiveIterable.makeString(String, String, String).appendString in interface PrimitiveIterablepublic MutableShortList toList()
toList in interface ShortIterablepublic MutableShortList toSortedList()
toSortedList in interface ShortIterablepublic MutableShortSet toSet()
toSet in interface ShortIterablepublic MutableShortBag toBag()
toBag in interface ShortIterablepublic LazyShortIterable asLazy()
asLazy in interface ShortIterablepublic MutableShortList asUnmodifiable()
asUnmodifiable in interface MutableShortCollectionasUnmodifiable in interface MutableShortListpublic MutableShortList asSynchronized()
asSynchronized in interface MutableShortCollectionasSynchronized in interface MutableShortListpublic ImmutableShortList toImmutable()
MutableShortListtoImmutable in interface MutableShortCollectiontoImmutable in interface MutableShortListtoImmutable in interface ShortListpublic void writeExternal(ObjectOutput out) throws IOException
writeExternal in interface ExternalizableIOExceptionpublic void readExternal(ObjectInput in) throws IOException
readExternal in interface ExternalizableIOExceptionpublic LazyShortIterable asReversed()
asReversed in interface ReversibleShortIterablepublic ShortArrayList reverseThis()
reverseThis in interface MutableShortListpublic ShortArrayList sortThis()
MutableShortListsortThis in interface MutableShortListpublic ShortArrayList toReversed()
toReversed in interface MutableShortListtoReversed in interface ShortListtoReversed in interface ReversibleShortIterablepublic MutableShortList subList(int fromIndex, int toIndex)
subList in interface MutableShortListsubList in interface ShortListList#subList(int fromIndex, int toIndex)}Copyright © 2004–2017. All rights reserved.