@NotThreadSafe public final class ByteArrayStack extends Object implements MutableByteStack, Externalizable
ArrayStack, and is memory-optimized for byte primitives.
This file was automatically generated from template file primitiveArrayStack.stg.| Constructor and Description |
|---|
ByteArrayStack() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
allSatisfy(BytePredicate predicate) |
boolean |
anySatisfy(BytePredicate 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. |
LazyByteIterable |
asLazy() |
MutableByteStack |
asSynchronized() |
MutableByteStack |
asUnmodifiable() |
double |
average() |
ByteIterator |
byteIterator() |
void |
clear()
Clears the Stack
|
<V> MutableStack<V> |
collect(ByteToObjectFunction<? extends V> function) |
boolean |
contains(byte value) |
boolean |
containsAll(byte... source) |
boolean |
containsAll(ByteIterable source) |
int |
count(BytePredicate predicate) |
byte |
detectIfNone(BytePredicate predicate,
byte ifNone) |
void |
each(ByteProcedure procedure) |
boolean |
equals(Object otherStack)
Follows the same general contract as
StackIterable.equals(Object). |
void |
forEach(ByteProcedure procedure) |
int |
hashCode()
Follows the same general contract as
StackIterable.hashCode(). |
<V> V |
injectInto(V injectedValue,
ObjectByteToObjectFunction<? 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.
|
byte |
max() |
byte |
maxIfEmpty(byte defaultValue) |
double |
median() |
byte |
min() |
byte |
minIfEmpty(byte defaultValue) |
static ByteArrayStack |
newStack(ByteIterable items) |
static ByteArrayStack |
newStackFromTopToBottom(byte... items) |
static ByteArrayStack |
newStackFromTopToBottom(ByteIterable items) |
static ByteArrayStack |
newStackWith(byte... items) |
boolean |
noneSatisfy(BytePredicate predicate) |
boolean |
notEmpty()
The English equivalent of !this.isEmpty()
|
byte |
peek()
Returns the top of the stack.
|
ByteList |
peek(int count)
Returns ByteList of the number of elements specified by the count, beginning with the top of the stack.
|
byte |
peekAt(int index)
Returns the element at the specified index.
|
byte |
pop()
Removes and returns the top element of the stack.
|
ByteList |
pop(int count)
Removes and returns a ByteList of the number of elements specified by the count, beginning with the top of the stack.
|
void |
push(byte item)
Adds an item to the top of the stack.
|
void |
readExternal(ObjectInput in) |
MutableByteStack |
reject(BytePredicate predicate) |
MutableByteStack |
select(BytePredicate predicate) |
int |
size()
Returns the number of items in this iterable.
|
long |
sum() |
byte[] |
toArray() |
MutableByteBag |
toBag() |
ImmutableByteStack |
toImmutable() |
MutableByteList |
toList() |
MutableByteSet |
toSet() |
byte[] |
toSortedArray() |
MutableByteList |
toSortedList() |
String |
toString()
Returns a string representation of this PrimitiveIterable.
|
void |
writeExternal(ObjectOutput out) |
public static ByteArrayStack newStackFromTopToBottom(byte... items)
public static ByteArrayStack newStackWith(byte... items)
public static ByteArrayStack newStack(ByteIterable items)
public static ByteArrayStack newStackFromTopToBottom(ByteIterable items)
public void push(byte item)
MutableByteStackpush in interface MutableByteStackpublic byte pop()
MutableByteStackpop in interface MutableByteStackpublic ByteList pop(int count)
MutableByteStackpop in interface MutableByteStackpublic MutableByteStack select(BytePredicate predicate)
select in interface ByteIterableselect in interface ByteStackselect in interface MutableByteStackpublic MutableByteStack reject(BytePredicate predicate)
reject in interface ByteIterablereject in interface ByteStackreject in interface MutableByteStackpublic byte peek()
ByteStackpublic ByteList peek(int count)
ByteStackpublic byte peekAt(int index)
ByteStackpublic ByteIterator byteIterator()
byteIterator in interface ByteIterablepublic void forEach(ByteProcedure procedure)
forEach in interface ByteIterablepublic void each(ByteProcedure procedure)
each in interface ByteIterablepublic int size()
PrimitiveIterablesize in interface PrimitiveIterablepublic boolean isEmpty()
PrimitiveIterableisEmpty in interface PrimitiveIterablepublic boolean notEmpty()
PrimitiveIterablenotEmpty in interface PrimitiveIterablepublic int count(BytePredicate predicate)
count in interface ByteIterablepublic boolean anySatisfy(BytePredicate predicate)
anySatisfy in interface ByteIterablepublic boolean allSatisfy(BytePredicate predicate)
allSatisfy in interface ByteIterablepublic boolean noneSatisfy(BytePredicate predicate)
noneSatisfy in interface ByteIterablepublic byte detectIfNone(BytePredicate predicate, byte ifNone)
detectIfNone in interface ByteIterablepublic <V> MutableStack<V> collect(ByteToObjectFunction<? extends V> function)
collect in interface ByteIterablecollect in interface ByteStackcollect in interface MutableByteStackpublic <V> V injectInto(V injectedValue,
ObjectByteToObjectFunction<? super V,? extends V> function)
injectInto in interface ByteIterablepublic long sum()
sum in interface ByteIterablepublic byte max()
max in interface ByteIterablepublic byte min()
min in interface ByteIterablepublic byte minIfEmpty(byte defaultValue)
minIfEmpty in interface ByteIterablepublic byte maxIfEmpty(byte defaultValue)
maxIfEmpty in interface ByteIterablepublic double average()
average in interface ByteIterablepublic double median()
median in interface ByteIterablepublic byte[] toSortedArray()
toSortedArray in interface ByteIterablepublic byte[] toArray()
toArray in interface ByteIterablepublic boolean contains(byte value)
contains in interface ByteIterablepublic boolean containsAll(byte... source)
containsAll in interface ByteIterablepublic boolean containsAll(ByteIterable source)
containsAll in interface ByteIterablepublic void clear()
MutableByteStackclear in interface MutableByteStackpublic boolean equals(Object otherStack)
ByteStackStackIterable.equals(Object).public int hashCode()
ByteStackStackIterable.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 MutableByteList toList()
toList in interface ByteIterablepublic MutableByteList toSortedList()
toSortedList in interface ByteIterablepublic MutableByteSet toSet()
toSet in interface ByteIterablepublic MutableByteBag toBag()
toBag in interface ByteIterablepublic LazyByteIterable asLazy()
asLazy in interface ByteIterablepublic MutableByteStack asUnmodifiable()
asUnmodifiable in interface MutableByteStackpublic MutableByteStack asSynchronized()
asSynchronized in interface MutableByteStackpublic ImmutableByteStack toImmutable()
toImmutable in interface ByteStackpublic 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.