@NotThreadSafe public final class ShortArrayStack extends Object implements MutableShortStack, Externalizable
ArrayStack
, and is memory-optimized for short primitives.
This file was automatically generated from template file primitiveArrayStack.stg.Constructor and Description |
---|
ShortArrayStack() |
Modifier and Type | Method and Description |
---|---|
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() |
MutableShortStack |
asSynchronized() |
MutableShortStack |
asUnmodifiable() |
double |
average() |
void |
clear()
Clears the Stack
|
<V> MutableStack<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) |
void |
each(ShortProcedure procedure) |
boolean |
equals(Object otherStack)
Follows the same general contract as
StackIterable.equals(Object) . |
void |
forEach(ShortProcedure procedure) |
int |
hashCode()
Follows the same general contract as
StackIterable.hashCode() . |
<V> V |
injectInto(V injectedValue,
ObjectShortToObjectFunction<? super V,? extends V> function) |
boolean |
isEmpty()
Returns true if this iterable has zero items.
|
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 ShortArrayStack |
newStack(ShortIterable items) |
static ShortArrayStack |
newStackFromTopToBottom(short... items) |
static ShortArrayStack |
newStackFromTopToBottom(ShortIterable items) |
static ShortArrayStack |
newStackWith(short... items) |
boolean |
noneSatisfy(ShortPredicate predicate) |
boolean |
notEmpty()
The English equivalent of !this.isEmpty()
|
short |
peek()
Returns the top of the stack.
|
ShortList |
peek(int count)
Returns ShortList of the number of elements specified by the count, beginning with the top of the stack.
|
short |
peekAt(int index)
Returns the element at the specified index.
|
short |
pop()
Removes and returns the top element of the stack.
|
ShortList |
pop(int count)
Removes and returns a ShortList of the number of elements specified by the count, beginning with the top of the stack.
|
void |
push(short item)
Adds an item to the top of the stack.
|
void |
readExternal(ObjectInput in) |
MutableShortStack |
reject(ShortPredicate predicate) |
MutableShortStack |
select(ShortPredicate predicate) |
ShortIterator |
shortIterator() |
int |
size()
Returns the number of items in this iterable.
|
long |
sum() |
short[] |
toArray() |
MutableShortBag |
toBag() |
ImmutableShortStack |
toImmutable() |
MutableShortList |
toList() |
MutableShortSet |
toSet() |
short[] |
toSortedArray() |
MutableShortList |
toSortedList() |
String |
toString()
Returns a string representation of this PrimitiveIterable.
|
void |
writeExternal(ObjectOutput out) |
public static ShortArrayStack newStackFromTopToBottom(short... items)
public static ShortArrayStack newStackWith(short... items)
public static ShortArrayStack newStack(ShortIterable items)
public static ShortArrayStack newStackFromTopToBottom(ShortIterable items)
public void push(short item)
MutableShortStack
push
in interface MutableShortStack
public short pop()
MutableShortStack
pop
in interface MutableShortStack
public ShortList pop(int count)
MutableShortStack
pop
in interface MutableShortStack
public MutableShortStack select(ShortPredicate predicate)
select
in interface ShortIterable
select
in interface MutableShortStack
select
in interface ShortStack
public MutableShortStack reject(ShortPredicate predicate)
reject
in interface ShortIterable
reject
in interface MutableShortStack
reject
in interface ShortStack
public short peek()
ShortStack
peek
in interface ShortStack
public ShortList peek(int count)
ShortStack
peek
in interface ShortStack
public short peekAt(int index)
ShortStack
peekAt
in interface ShortStack
index
- the location to peek intopublic ShortIterator shortIterator()
shortIterator
in interface ShortIterable
public void forEach(ShortProcedure procedure)
forEach
in interface ShortIterable
public void each(ShortProcedure procedure)
each
in interface ShortIterable
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 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 short detectIfNone(ShortPredicate predicate, short ifNone)
detectIfNone
in interface ShortIterable
public <V> MutableStack<V> collect(ShortToObjectFunction<? extends V> function)
collect
in interface ShortIterable
collect
in interface MutableShortStack
collect
in interface ShortStack
public <V> V injectInto(V injectedValue, ObjectShortToObjectFunction<? super V,? extends V> function)
injectInto
in interface ShortIterable
public long sum()
sum
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 double average()
average
in interface ShortIterable
public double median()
median
in interface ShortIterable
public short[] toSortedArray()
toSortedArray
in interface ShortIterable
public short[] toArray()
toArray
in interface ShortIterable
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 void clear()
MutableShortStack
clear
in interface MutableShortStack
public boolean equals(Object otherStack)
ShortStack
StackIterable.equals(Object)
.equals
in interface ShortStack
equals
in class Object
public int hashCode()
ShortStack
StackIterable.hashCode()
.hashCode
in interface ShortStack
hashCode
in class Object
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 MutableShortStack asUnmodifiable()
asUnmodifiable
in interface MutableShortStack
public MutableShortStack asSynchronized()
asSynchronized
in interface MutableShortStack
public ImmutableShortStack toImmutable()
toImmutable
in interface ShortStack
public void writeExternal(ObjectOutput out) throws IOException
writeExternal
in interface Externalizable
IOException
public void readExternal(ObjectInput in) throws IOException
readExternal
in interface Externalizable
IOException
Copyright © 2004–2016. All rights reserved.