Package net.algart.arrays
Interface ByteStack
- All Superinterfaces:
- Stack
- All Known Subinterfaces:
- MutableByteArray
Stack of byte values.
- Author:
- Daniel Alievsky
- 
Method SummaryMethods inherited from interface net.algart.arrays.Stackclear, length, popElement, pushElement, removeTop
- 
Method Details- 
popBytebyte popByte()Removes the element at the top of this stack and returns its value, or throws EmptyStackException if the stack is empty.It this object is an AlgART byte array, implementing MutableByteArrayinterface, and it is not empty, the same action may be performed by the following code:byte result = byteArray. getByte(byteArray.length()-1); byteArray.length(byteArray.length()-1);- Returns:
- the element at the top of this stack (it is removed from the stack by this method).
- Throws:
- EmptyStackException- if this stack is empty.
 
- 
pushBytevoid pushByte(byte value) Appends value element to the end of this stack.It this object is an AlgART byte array, implementing MutableByteArrayinterface, the same action may be performed by the following code:byteArray. length(byteArray.length()+1); byteArray.setByte(byteArray.length()-1, value);- Parameters:
- value- to be added to the top of this stack.
- Throws:
- TooLargeArrayException- if the resulting stack length is too large for this type of stacks.
 
 
-