Top Description Fields Constructors Methods
org.eclipse.collections.impl.stack.mutable.primitive

public Class ByteArrayStack

extends AbstractByteStack
implements MutableByteStack, Externalizable
Class Inheritance
All Implemented Interfaces
java.io.Externalizable, java.io.Serializable, org.eclipse.collections.api.stack.primitive.MutableByteStack, org.eclipse.collections.api.stack.primitive.ByteStack, org.eclipse.collections.api.ordered.primitive.OrderedByteIterable, org.eclipse.collections.api.ByteIterable, org.eclipse.collections.api.PrimitiveIterable
Imports
java.io.Externalizable, .IOException, .ObjectInput, .ObjectOutput, org.eclipse.collections.api.ByteIterable, org.eclipse.collections.api.block.function.primitive.ByteToObjectFunction, org.eclipse.collections.api.block.predicate.primitive.BytePredicate, org.eclipse.collections.api.iterator.ByteIterator, org.eclipse.collections.api.list.primitive.ByteList, .MutableByteList, org.eclipse.collections.api.stack.MutableStack, org.eclipse.collections.api.stack.primitive.ByteStack, .ImmutableByteStack, .MutableByteStack, org.eclipse.collections.impl.factory.primitive.ByteStacks, org.eclipse.collections.impl.list.mutable.primitive.ByteArrayList, org.eclipse.collections.impl.stack.primitive.AbstractByteStack, org.eclipse.collections.impl.stack.mutable.ArrayStack

ByteArrayStack is similar to ArrayStack, and is memory-optimized for byte primitives. This file was automatically generated from template file primitiveArrayStack.stg.

Field Summary

Modifier and TypeField and Description
private transient ByteArrayList
private static final long

Constructor Summary

AccessConstructor and Description
public
private
ByteArrayStack(int size)

private
ByteArrayStack(byte... items)

Method Summary

Modifier and TypeMethod and Description
public MutableByteStack
public MutableByteStack
public void
public <V> MutableStack<V>
collect(ByteToObjectFunction<? extends V> function)

Implements org.eclipse.collections.api.stack.primitive.MutableByteStack.collect, org.eclipse.collections.api.stack.primitive.ByteStack.collect.

Returns a new collection with the results of applying the specified function on each element of the source collection.

public boolean
protected ByteArrayList
public int
public ByteArrayStack
newEmpty()

Overrides default org.eclipse.collections.api.stack.primitive.MutableByteStack.newEmpty.

Creates a new empty ByteArrayStack.

public static ByteArrayStack
public static ByteArrayStack
newStackFromTopToBottom(byte... items)

public static ByteArrayStack
public static ByteArrayStack
newStackWith(byte... items)

public byte
pop()

Implements org.eclipse.collections.api.stack.primitive.MutableByteStack.pop.

Removes and returns the top element of the stack.

public ByteList
pop(int count)

Implements org.eclipse.collections.api.stack.primitive.MutableByteStack.pop.

Removes and returns a ByteList of the number of elements specified by the count, beginning with the top of the stack.

public void
push(byte item)

Implements org.eclipse.collections.api.stack.primitive.MutableByteStack.push.

Adds an item to the top of the stack.

public void
readExternal(ObjectInput in)

Implements java.io.Externalizable.readExternal.

The object implements the readExternal method to restore its contents by calling the methods of DataInput for primitive types and readObject for objects, strings and arrays.

public MutableByteStack
reject(BytePredicate predicate)

Implements org.eclipse.collections.api.stack.primitive.MutableByteStack.reject, org.eclipse.collections.api.stack.primitive.ByteStack.reject.

Returns a new ByteIterable with all of the elements in the ByteIterable that return false for the specified predicate.

public MutableByteStack
select(BytePredicate predicate)

Implements org.eclipse.collections.api.stack.primitive.MutableByteStack.select, org.eclipse.collections.api.stack.primitive.ByteStack.select.

Returns a new ByteIterable with all of the elements in the ByteIterable that return true for the specified predicate.

public ImmutableByteStack
public MutableByteList
public MutableByteStack
toStack()

Overrides default org.eclipse.collections.api.ordered.primitive.OrderedByteIterable.toStack.

Converts the collection to a ByteStack.

public void
writeExternal(ObjectOutput out)

Implements java.io.Externalizable.writeExternal.

The object implements the writeExternal method to save its contents by calling the methods of DataOutput for its primitive values or calling the writeObject method of ObjectOutput for objects, strings, and arrays.

Inherited from org.eclipse.collections.impl.stack.primitive.AbstractByteStack:
allSatisfyanySatisfyappendStringappendStringappendStringasLazyaveragebyteIteratorcheckEmptyStackcheckPositiveValueForCountcheckSizeLessThanCountchunkcontainscontainsAllcontainsAllcountdetectIfNoneeachforEachWithIndexgetFirstindexOfinjectIntoinjectIntoWithIndexmakeStringmakeStringmakeStringmaxmaxIfEmptymedianminminIfEmptynoneSatisfypeekpeekpeekAtrangeChecksizesumtoArraytoArraytoBagtoListtoSettoSortedArraytoString

Field Detail

delegateback to summary
private transient ByteArrayList delegate
serialVersionUIDback to summary
private static final long serialVersionUID

Constructor Detail

ByteArrayStackback to summary
public ByteArrayStack()
ByteArrayStackback to summary
private ByteArrayStack(int size)
ByteArrayStackback to summary
private ByteArrayStack(byte... items)

Method Detail

asSynchronizedback to summary
public MutableByteStack asSynchronized()

Implements org.eclipse.collections.api.stack.primitive.MutableByteStack.asSynchronized.

Annotations
@Override
asUnmodifiableback to summary
public MutableByteStack asUnmodifiable()

Implements org.eclipse.collections.api.stack.primitive.MutableByteStack.asUnmodifiable.

Annotations
@Override
clearback to summary
public void clear()

Implements org.eclipse.collections.api.stack.primitive.MutableByteStack.clear.

Doc from org.eclipse.collections.api.stack.primitive.MutableByteStack.clear.

Clears the Stack

Annotations
@Override
collectback to summary
public <V> MutableStack<V> collect(ByteToObjectFunction<? extends V> function)

Implements org.eclipse.collections.api.stack.primitive.MutableByteStack.collect, org.eclipse.collections.api.stack.primitive.ByteStack.collect.

Doc from org.eclipse.collections.api.ByteIterable.collect.

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.

Annotations
@Override
equalsback to summary
public boolean equals(Object otherStack)

Overrides org.eclipse.collections.impl.stack.primitive.AbstractByteStack.equals.

Implements org.eclipse.collections.api.stack.primitive.ByteStack.equals.

Doc from org.eclipse.collections.api.stack.primitive.ByteStack.equals.

Follows the same general contract as StackIterable#equals(Object).

Annotations
@Override
getDelegateback to summary
protected ByteArrayList getDelegate()

Implements abstract org.eclipse.collections.impl.stack.primitive.AbstractByteStack.getDelegate.

Annotations
@Override
hashCodeback to summary
public int hashCode()

Overrides org.eclipse.collections.impl.stack.primitive.AbstractByteStack.hashCode.

Implements org.eclipse.collections.api.stack.primitive.ByteStack.hashCode.

Doc from org.eclipse.collections.api.stack.primitive.ByteStack.hashCode.

Follows the same general contract as StackIterable#hashCode().

Annotations
@Override
newEmptyback to summary
public ByteArrayStack newEmpty()

Overrides default org.eclipse.collections.api.stack.primitive.MutableByteStack.newEmpty.

Creates a new empty ByteArrayStack.

Annotations
@Override
Since
9.2.
newStackback to summary
public static ByteArrayStack newStack(ByteIterable items)
newStackFromTopToBottomback to summary
public static ByteArrayStack newStackFromTopToBottom(byte... items)
newStackFromTopToBottomback to summary
public static ByteArrayStack newStackFromTopToBottom(ByteIterable items)
newStackWithback to summary
public static ByteArrayStack newStackWith(byte... items)
popback to summary
public byte pop()

Implements org.eclipse.collections.api.stack.primitive.MutableByteStack.pop.

Doc from org.eclipse.collections.api.stack.primitive.MutableByteStack.pop.

Removes and returns the top element of the stack.

Annotations
@Override
popback to summary
public ByteList pop(int count)

Implements org.eclipse.collections.api.stack.primitive.MutableByteStack.pop.

Doc from org.eclipse.collections.api.stack.primitive.MutableByteStack.pop.

Removes and returns a ByteList of the number of elements specified by the count, beginning with the top of the stack.

Annotations
@Override
pushback to summary
public void push(byte item)

Implements org.eclipse.collections.api.stack.primitive.MutableByteStack.push.

Doc from org.eclipse.collections.api.stack.primitive.MutableByteStack.push.

Adds an item to the top of the stack.

Annotations
@Override
readExternalback to summary
public void readExternal(ObjectInput in) throws IOException

Implements java.io.Externalizable.readExternal.

Doc from java.io.Externalizable.readExternal.

The object implements the readExternal method to restore its contents by calling the methods of DataInput for primitive types and readObject for objects, strings and arrays. The readExternal method must read the values in the same sequence and with the same types as were written by writeExternal.

Annotations
@Override
Exceptions
IOException:
if I/O errors occur
rejectback to summary
public MutableByteStack reject(BytePredicate predicate)

Implements org.eclipse.collections.api.stack.primitive.MutableByteStack.reject, org.eclipse.collections.api.stack.primitive.ByteStack.reject.

Doc from org.eclipse.collections.api.ByteIterable.reject.

Returns a new ByteIterable with all of the elements in the ByteIterable that return false for the specified predicate.

Annotations
@Override
selectback to summary
public MutableByteStack select(BytePredicate predicate)

Implements org.eclipse.collections.api.stack.primitive.MutableByteStack.select, org.eclipse.collections.api.stack.primitive.ByteStack.select.

Doc from org.eclipse.collections.api.ByteIterable.select.

Returns a new ByteIterable with all of the elements in the ByteIterable that return true for the specified predicate.

Annotations
@Override
toImmutableback to summary
public ImmutableByteStack toImmutable()

Implements org.eclipse.collections.api.stack.primitive.ByteStack.toImmutable.

Annotations
@Override
toSortedListback to summary
public MutableByteList toSortedList()

Implements org.eclipse.collections.api.ByteIterable.toSortedList.

Annotations
@Override
toStackback to summary
public MutableByteStack toStack()

Overrides default org.eclipse.collections.api.ordered.primitive.OrderedByteIterable.toStack.

Doc from org.eclipse.collections.api.ordered.primitive.OrderedByteIterable.toStack.

Converts the collection to a ByteStack.

Annotations
@Override
writeExternalback to summary
public void writeExternal(ObjectOutput out) throws IOException

Implements java.io.Externalizable.writeExternal.

Doc from java.io.Externalizable.writeExternal.

The object implements the writeExternal method to save its contents by calling the methods of DataOutput for its primitive values or calling the writeObject method of ObjectOutput for objects, strings, and arrays.

Annotations
@Override
Exceptions
IOException:
Includes any I/O exceptions that may occur