@NotThreadSafe public final class LongArrayList extends Object implements MutableLongList, Externalizable
FastList, and is memory-optimized for long primitives.
This file was automatically generated from template file primitiveArrayList.stg.| Constructor and Description |
|---|
LongArrayList() |
LongArrayList(int initialCapacity) |
LongArrayList(long... array) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(long newItem) |
boolean |
addAll(long... source) |
boolean |
addAll(LongIterable source) |
boolean |
addAllAtIndex(int index,
long... source) |
boolean |
addAllAtIndex(int index,
LongIterable source) |
void |
addAtIndex(int index,
long element) |
boolean |
allSatisfy(LongPredicate predicate) |
boolean |
anySatisfy(LongPredicate 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. |
LazyLongIterable |
asLazy() |
LazyLongIterable |
asReversed() |
MutableLongList |
asSynchronized() |
MutableLongList |
asUnmodifiable() |
double |
average() |
void |
clear() |
<V> MutableList<V> |
collect(LongToObjectFunction<? extends V> function) |
boolean |
contains(long value) |
boolean |
containsAll(long... source) |
boolean |
containsAll(LongIterable source) |
int |
count(LongPredicate predicate) |
long |
detectIfNone(LongPredicate predicate,
long ifNone) |
long |
dotProduct(LongList list) |
void |
ensureCapacity(int minCapacity) |
boolean |
equals(Object otherList)
Follows the same general contract as
List.equals(Object). |
void |
forEach(LongProcedure procedure) |
void |
forEachWithIndex(LongIntProcedure procedure) |
long |
get(int index) |
long |
getFirst() |
long |
getLast() |
int |
hashCode()
Follows the same general contract as
List.hashCode(). |
int |
indexOf(long value) |
<T> T |
injectInto(T injectedValue,
ObjectLongToObjectFunction<? super T,? extends T> function) |
<T> T |
injectIntoWithIndex(T injectedValue,
ObjectLongIntToObjectFunction<? super T,? extends T> function) |
boolean |
isEmpty()
Returns true if this iterable has zero items.
|
int |
lastIndexOf(long value) |
LongIterator |
longIterator() |
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.
|
long |
max() |
long |
maxIfEmpty(long defaultValue) |
double |
median() |
long |
min() |
long |
minIfEmpty(long defaultValue) |
static LongArrayList |
newList(LongIterable source) |
static LongArrayList |
newListWith(long... elements)
Creates a new list using the passed
elements argument as the backing store. |
static LongArrayList |
newWithNValues(int size,
long value) |
boolean |
noneSatisfy(LongPredicate predicate) |
boolean |
notEmpty()
The English equivalent of !this.isEmpty()
|
void |
readExternal(ObjectInput in) |
LongArrayList |
reject(LongPredicate predicate) |
boolean |
remove(long value) |
boolean |
removeAll(long... source) |
boolean |
removeAll(LongIterable source) |
long |
removeAtIndex(int index) |
boolean |
retainAll(long... source) |
boolean |
retainAll(LongIterable source) |
LongArrayList |
reverseThis() |
LongArrayList |
select(LongPredicate predicate) |
long |
set(int index,
long element) |
int |
size()
Returns the number of items in this iterable.
|
LongArrayList |
sortThis()
Sorts this list mutating its contents and returns the same mutable list (this).
|
MutableLongList |
subList(int fromIndex,
int toIndex) |
long |
sum() |
long[] |
toArray() |
MutableLongBag |
toBag() |
ImmutableLongList |
toImmutable()
Returns an immutable copy of this list.
|
MutableLongList |
toList() |
LongArrayList |
toReversed() |
MutableLongSet |
toSet() |
long[] |
toSortedArray() |
MutableLongList |
toSortedList() |
String |
toString()
Returns a string representation of this PrimitiveIterable.
|
void |
trimToSize() |
LongArrayList |
with(long element) |
LongArrayList |
with(long element1,
long element2) |
LongArrayList |
with(long element1,
long element2,
long element3) |
LongArrayList |
with(long element1,
long element2,
long element3,
long... elements) |
LongArrayList |
withAll(LongIterable elements) |
LongArrayList |
without(long element) |
LongArrayList |
withoutAll(LongIterable elements) |
void |
writeExternal(ObjectOutput out) |
public LongArrayList()
public LongArrayList(int initialCapacity)
public LongArrayList(long... array)
public static LongArrayList newListWith(long... 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 LongArrayList newList(LongIterable source)
public static LongArrayList newWithNValues(int size, long 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 MutableLongCollectionpublic boolean contains(long value)
contains in interface LongIterablepublic boolean containsAll(long... source)
containsAll in interface LongIterablepublic boolean containsAll(LongIterable source)
containsAll in interface LongIterablepublic long getFirst()
getFirst in interface ReversibleLongIterablepublic long getLast()
getLast in interface ReversibleLongIterablepublic int indexOf(long value)
indexOf in interface ReversibleLongIterablepublic int lastIndexOf(long value)
lastIndexOf in interface LongListpublic void trimToSize()
public void ensureCapacity(int minCapacity)
public boolean add(long newItem)
add in interface MutableLongCollectionpublic boolean addAll(long... source)
addAll in interface MutableLongCollectionpublic boolean addAll(LongIterable source)
addAll in interface MutableLongCollectionpublic void addAtIndex(int index,
long element)
addAtIndex in interface MutableLongListpublic boolean addAllAtIndex(int index,
long... source)
addAllAtIndex in interface MutableLongListpublic boolean addAllAtIndex(int index,
LongIterable source)
addAllAtIndex in interface MutableLongListpublic boolean remove(long value)
remove in interface MutableLongCollectionpublic boolean removeAll(LongIterable source)
removeAll in interface MutableLongCollectionpublic boolean removeAll(long... source)
removeAll in interface MutableLongCollectionpublic boolean retainAll(LongIterable source)
retainAll in interface MutableLongCollectionCollection.retainAll(Collection)public boolean retainAll(long... source)
retainAll in interface MutableLongCollectionCollection.retainAll(Collection)public long removeAtIndex(int index)
removeAtIndex in interface MutableLongListpublic long set(int index,
long element)
set in interface MutableLongListpublic LongArrayList with(long element)
with in interface MutableLongCollectionwith in interface MutableLongListpublic LongArrayList without(long element)
without in interface MutableLongCollectionwithout in interface MutableLongListpublic LongArrayList withAll(LongIterable elements)
withAll in interface MutableLongCollectionwithAll in interface MutableLongListpublic LongArrayList withoutAll(LongIterable elements)
withoutAll in interface MutableLongCollectionwithoutAll in interface MutableLongListpublic LongArrayList with(long element1, long element2)
public LongArrayList with(long element1, long element2, long element3)
public LongArrayList with(long element1, long element2, long element3, long... elements)
public LongIterator longIterator()
longIterator in interface LongIterablepublic void forEach(LongProcedure procedure)
forEach in interface LongIterablepublic void forEachWithIndex(LongIntProcedure procedure)
forEachWithIndex in interface ReversibleLongIterablepublic <T> T injectInto(T injectedValue,
ObjectLongToObjectFunction<? super T,? extends T> function)
injectInto in interface LongIterablepublic <T> T injectIntoWithIndex(T injectedValue,
ObjectLongIntToObjectFunction<? super T,? extends T> function)
injectIntoWithIndex in interface ReversibleLongIterablepublic int count(LongPredicate predicate)
count in interface LongIterablepublic boolean anySatisfy(LongPredicate predicate)
anySatisfy in interface LongIterablepublic boolean allSatisfy(LongPredicate predicate)
allSatisfy in interface LongIterablepublic boolean noneSatisfy(LongPredicate predicate)
noneSatisfy in interface LongIterablepublic LongArrayList select(LongPredicate predicate)
select in interface MutableLongCollectionselect in interface LongListselect in interface MutableLongListselect in interface LongIterableselect in interface ReversibleLongIterablepublic LongArrayList reject(LongPredicate predicate)
reject in interface MutableLongCollectionreject in interface LongListreject in interface MutableLongListreject in interface LongIterablereject in interface ReversibleLongIterablepublic long detectIfNone(LongPredicate predicate, long ifNone)
detectIfNone in interface LongIterablepublic <V> MutableList<V> collect(LongToObjectFunction<? extends V> function)
collect in interface MutableLongCollectioncollect in interface LongListcollect in interface MutableLongListcollect in interface LongIterablecollect in interface ReversibleLongIterablepublic long max()
max in interface LongIterablepublic long min()
min in interface LongIterablepublic long minIfEmpty(long defaultValue)
minIfEmpty in interface LongIterablepublic long maxIfEmpty(long defaultValue)
maxIfEmpty in interface LongIterablepublic long sum()
sum in interface LongIterablepublic long dotProduct(LongList list)
dotProduct in interface LongListpublic double average()
average in interface LongIterablepublic double median()
median in interface LongIterablepublic long[] toArray()
toArray in interface LongIterablepublic long[] toSortedArray()
toSortedArray in interface LongIterablepublic boolean equals(Object otherList)
LongListList.equals(Object).public int hashCode()
LongListList.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 MutableLongList toList()
toList in interface LongIterablepublic MutableLongList toSortedList()
toSortedList in interface LongIterablepublic MutableLongSet toSet()
toSet in interface LongIterablepublic MutableLongBag toBag()
toBag in interface LongIterablepublic LazyLongIterable asLazy()
asLazy in interface LongIterablepublic MutableLongList asUnmodifiable()
asUnmodifiable in interface MutableLongCollectionasUnmodifiable in interface MutableLongListpublic MutableLongList asSynchronized()
asSynchronized in interface MutableLongCollectionasSynchronized in interface MutableLongListpublic ImmutableLongList toImmutable()
MutableLongListtoImmutable in interface MutableLongCollectiontoImmutable in interface LongListtoImmutable in interface MutableLongListpublic void writeExternal(ObjectOutput out) throws IOException
writeExternal in interface ExternalizableIOExceptionpublic void readExternal(ObjectInput in) throws IOException
readExternal in interface ExternalizableIOExceptionpublic LazyLongIterable asReversed()
asReversed in interface ReversibleLongIterablepublic LongArrayList reverseThis()
reverseThis in interface MutableLongListpublic LongArrayList sortThis()
MutableLongListsortThis in interface MutableLongListpublic LongArrayList toReversed()
toReversed in interface LongListtoReversed in interface MutableLongListtoReversed in interface ReversibleLongIterablepublic MutableLongList subList(int fromIndex, int toIndex)
subList in interface LongListsubList in interface MutableLongListList#subList(int fromIndex, int toIndex)}Copyright © 2004–2017. All rights reserved.