Class ByteArrayStack
java.lang.Object
org.eclipse.collections.impl.stack.primitive.AbstractByteStack
org.eclipse.collections.impl.stack.mutable.primitive.ByteArrayStack
- All Implemented Interfaces:
Externalizable
,Serializable
,ByteIterable
,OrderedByteIterable
,PrimitiveIterable
,ByteStack
,MutableByteStack
public class ByteArrayStack extends AbstractByteStack implements MutableByteStack, Externalizable
ByteArrayStack is similar to
ArrayStack
, and is memory-optimized for byte primitives.
This file was automatically generated from template file primitiveArrayStack.stg.- See Also:
- Serialized Form
-
Constructor Summary
Constructors Constructor Description ByteArrayStack()
-
Method Summary
Modifier and Type Method Description MutableByteStack
asSynchronized()
MutableByteStack
asUnmodifiable()
void
clear()
Clears the Stack<V> MutableStack<V>
collect(ByteToObjectFunction<? extends V> function)
Returns a new collection with the results of applying the specified function on each element of the source collection.boolean
equals(Object otherStack)
Follows the same general contract asStackIterable.equals(Object)
.int
hashCode()
Follows the same general contract asStackIterable.hashCode()
.ByteArrayStack
newEmpty()
Creates a new empty ByteArrayStack.static ByteArrayStack
newStack(ByteIterable items)
static ByteArrayStack
newStackFromTopToBottom(byte... items)
static ByteArrayStack
newStackFromTopToBottom(ByteIterable items)
static ByteArrayStack
newStackWith(byte... items)
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)
Returns a new ByteIterable with all of the elements in the ByteIterable that return false for the specified predicate.MutableByteStack
select(BytePredicate predicate)
Returns a new ByteIterable with all of the elements in the ByteIterable that return true for the specified predicate.ImmutableByteStack
toImmutable()
MutableByteList
toSortedList()
void
writeExternal(ObjectOutput out)
Methods inherited from class org.eclipse.collections.impl.stack.primitive.AbstractByteStack
allSatisfy, anySatisfy, appendString, appendString, appendString, asLazy, average, byteIterator, chunk, contains, containsAll, containsAll, count, detectIfNone, each, forEach, forEachWithIndex, getFirst, indexOf, injectInto, injectIntoWithIndex, makeString, makeString, makeString, max, maxIfEmpty, median, min, minIfEmpty, noneSatisfy, peek, peek, peekAt, size, sum, toArray, toArray, toBag, toList, toSet, toSortedArray, toString
Methods inherited from interface org.eclipse.collections.api.ByteIterable
allSatisfy, anySatisfy, asLazy, average, averageIfEmpty, byteIterator, chunk, collect, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectInt, collectLong, collectShort, contains, containsAll, containsAll, count, detectIfNone, each, flatCollect, forEach, injectInto, max, maxIfEmpty, median, medianIfEmpty, min, minIfEmpty, noneSatisfy, reduce, reduceIfEmpty, reject, select, sum, summaryStatistics, toArray, toArray, toBag, toList, toSet, toSortedArray
Methods inherited from interface org.eclipse.collections.api.stack.primitive.ByteStack
peek, peek, peekAt
Methods inherited from interface org.eclipse.collections.api.stack.primitive.MutableByteStack
collectWithIndex, tap
Methods inherited from interface org.eclipse.collections.api.ordered.primitive.OrderedByteIterable
collectWithIndex, forEachWithIndex, getFirst, indexOf, injectIntoWithIndex
Methods inherited from interface org.eclipse.collections.api.PrimitiveIterable
appendString, appendString, appendString, isEmpty, makeString, makeString, makeString, notEmpty, size, toString
-
Constructor Details
-
ByteArrayStack
public ByteArrayStack()
-
-
Method Details
-
newStackFromTopToBottom
-
newStackWith
-
newStack
-
newStackFromTopToBottom
-
push
public void push(byte item)Description copied from interface:MutableByteStack
Adds an item to the top of the stack.- Specified by:
push
in interfaceMutableByteStack
-
pop
public byte pop()Description copied from interface:MutableByteStack
Removes and returns the top element of the stack.- Specified by:
pop
in interfaceMutableByteStack
-
pop
Description copied from interface:MutableByteStack
Removes and returns a ByteList of the number of elements specified by the count, beginning with the top of the stack.- Specified by:
pop
in interfaceMutableByteStack
-
select
Description copied from interface:ByteIterable
Returns a new ByteIterable with all of the elements in the ByteIterable that return true for the specified predicate.- Specified by:
select
in interfaceByteIterable
- Specified by:
select
in interfaceByteStack
- Specified by:
select
in interfaceMutableByteStack
- Specified by:
select
in interfaceOrderedByteIterable
-
reject
Description copied from interface:ByteIterable
Returns a new ByteIterable with all of the elements in the ByteIterable that return false for the specified predicate.- Specified by:
reject
in interfaceByteIterable
- Specified by:
reject
in interfaceByteStack
- Specified by:
reject
in interfaceMutableByteStack
- Specified by:
reject
in interfaceOrderedByteIterable
-
collect
Description copied from interface:ByteIterable
Returns a new collection with the results of applying the specified function on each element of the source collection. This method is also commonly called transform or map.- Specified by:
collect
in interfaceByteIterable
- Specified by:
collect
in interfaceByteStack
- Specified by:
collect
in interfaceMutableByteStack
- Specified by:
collect
in interfaceOrderedByteIterable
-
clear
public void clear()Description copied from interface:MutableByteStack
Clears the Stack- Specified by:
clear
in interfaceMutableByteStack
-
toSortedList
- Specified by:
toSortedList
in interfaceByteIterable
-
asUnmodifiable
- Specified by:
asUnmodifiable
in interfaceMutableByteStack
-
asSynchronized
- Specified by:
asSynchronized
in interfaceMutableByteStack
-
toImmutable
- Specified by:
toImmutable
in interfaceByteStack
-
newEmpty
Creates a new empty ByteArrayStack.- Specified by:
newEmpty
in interfaceMutableByteStack
- Since:
- 9.2.
-
equals
Description copied from interface:ByteStack
Follows the same general contract asStackIterable.equals(Object)
.- Specified by:
equals
in interfaceByteStack
- Overrides:
equals
in classAbstractByteStack
-
hashCode
public int hashCode()Description copied from interface:ByteStack
Follows the same general contract asStackIterable.hashCode()
.- Specified by:
hashCode
in interfaceByteStack
- Overrides:
hashCode
in classAbstractByteStack
-
writeExternal
- Specified by:
writeExternal
in interfaceExternalizable
- Throws:
IOException
-
readExternal
- Specified by:
readExternal
in interfaceExternalizable
- Throws:
IOException
-