@NotThreadSafe public final class LongArrayStack extends Object implements MutableLongStack, Externalizable
ArrayStack, and is memory-optimized for long primitives.
This file was automatically generated from template file primitiveArrayStack.stg.| Constructor and Description |
|---|
LongArrayStack() |
| Modifier and Type | Method and Description |
|---|---|
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() |
MutableLongStack |
asSynchronized() |
MutableLongStack |
asUnmodifiable() |
double |
average() |
void |
clear()
Clears the Stack
|
<V> MutableStack<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) |
void |
each(LongProcedure procedure) |
boolean |
equals(Object otherStack)
Follows the same general contract as
StackIterable.equals(Object). |
void |
forEach(LongProcedure procedure) |
int |
hashCode()
Follows the same general contract as
StackIterable.hashCode(). |
<V> V |
injectInto(V injectedValue,
ObjectLongToObjectFunction<? super V,? extends V> function) |
boolean |
isEmpty()
Returns true if this iterable has zero items.
|
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 LongArrayStack |
newStack(LongIterable items) |
static LongArrayStack |
newStackFromTopToBottom(long... items) |
static LongArrayStack |
newStackFromTopToBottom(LongIterable items) |
static LongArrayStack |
newStackWith(long... items) |
boolean |
noneSatisfy(LongPredicate predicate) |
boolean |
notEmpty()
The English equivalent of !this.isEmpty()
|
long |
peek()
Returns the top of the stack.
|
LongList |
peek(int count)
Returns LongList of the number of elements specified by the count, beginning with the top of the stack.
|
long |
peekAt(int index)
Returns the element at the specified index.
|
long |
pop()
Removes and returns the top element of the stack.
|
LongList |
pop(int count)
Removes and returns a LongList of the number of elements specified by the count, beginning with the top of the stack.
|
void |
push(long item)
Adds an item to the top of the stack.
|
void |
readExternal(ObjectInput in) |
MutableLongStack |
reject(LongPredicate predicate) |
MutableLongStack |
select(LongPredicate predicate) |
int |
size()
Returns the number of items in this iterable.
|
long |
sum() |
long[] |
toArray() |
MutableLongBag |
toBag() |
ImmutableLongStack |
toImmutable() |
MutableLongList |
toList() |
MutableLongSet |
toSet() |
long[] |
toSortedArray() |
MutableLongList |
toSortedList() |
String |
toString()
Returns a string representation of this PrimitiveIterable.
|
void |
writeExternal(ObjectOutput out) |
public static LongArrayStack newStackFromTopToBottom(long... items)
public static LongArrayStack newStackWith(long... items)
public static LongArrayStack newStack(LongIterable items)
public static LongArrayStack newStackFromTopToBottom(LongIterable items)
public void push(long item)
MutableLongStackpush in interface MutableLongStackpublic long pop()
MutableLongStackpop in interface MutableLongStackpublic LongList pop(int count)
MutableLongStackpop in interface MutableLongStackpublic MutableLongStack select(LongPredicate predicate)
select in interface LongIterableselect in interface LongStackselect in interface MutableLongStackpublic MutableLongStack reject(LongPredicate predicate)
reject in interface LongIterablereject in interface LongStackreject in interface MutableLongStackpublic long peek()
LongStackpublic LongList peek(int count)
LongStackpublic long peekAt(int index)
LongStackpublic LongIterator longIterator()
longIterator in interface LongIterablepublic void forEach(LongProcedure procedure)
forEach in interface LongIterablepublic void each(LongProcedure procedure)
each in interface LongIterablepublic int size()
PrimitiveIterablesize in interface PrimitiveIterablepublic boolean isEmpty()
PrimitiveIterableisEmpty in interface PrimitiveIterablepublic boolean notEmpty()
PrimitiveIterablenotEmpty in interface PrimitiveIterablepublic 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 long detectIfNone(LongPredicate predicate, long ifNone)
detectIfNone in interface LongIterablepublic <V> MutableStack<V> collect(LongToObjectFunction<? extends V> function)
collect in interface LongIterablecollect in interface LongStackcollect in interface MutableLongStackpublic <V> V injectInto(V injectedValue,
ObjectLongToObjectFunction<? super V,? extends V> function)
injectInto in interface LongIterablepublic long sum()
sum in interface LongIterablepublic 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 double average()
average in interface LongIterablepublic double median()
median in interface LongIterablepublic long[] toSortedArray()
toSortedArray in interface LongIterablepublic long[] toArray()
toArray in interface LongIterablepublic boolean contains(long value)
contains in interface LongIterablepublic boolean containsAll(long... source)
containsAll in interface LongIterablepublic boolean containsAll(LongIterable source)
containsAll in interface LongIterablepublic void clear()
MutableLongStackclear in interface MutableLongStackpublic boolean equals(Object otherStack)
LongStackStackIterable.equals(Object).public int hashCode()
LongStackStackIterable.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 MutableLongStack asUnmodifiable()
asUnmodifiable in interface MutableLongStackpublic MutableLongStack asSynchronized()
asSynchronized in interface MutableLongStackpublic ImmutableLongStack toImmutable()
toImmutable in interface LongStackpublic void writeExternal(ObjectOutput out) throws IOException
writeExternal in interface ExternalizableIOExceptionpublic void readExternal(ObjectInput in) throws IOException
readExternal in interface ExternalizableIOExceptionCopyright © 2004–2016. All rights reserved.