Package gnu.trove.stack
Interface TByteStack
-
- All Known Implementing Classes:
TByteArrayStack
public interface TByteStackA stack of byte primitives.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidclear()Clears the stack.bytegetNoEntryValue()Returns the value that is used to represent null.bytepeek()Returns the value at the top of the stack.bytepop()Removes and returns the value at the top of the stack.voidpush(byte val)Pushes the value onto the top of the stack.intsize()Returns the current depth of the stack.byte[]toArray()Copies the contents of the stack into a native array.voidtoArray(byte[] dest)Copies a slice of the list into a native array.
-
-
-
Method Detail
-
getNoEntryValue
byte getNoEntryValue()
Returns the value that is used to represent null. The default value is generally zero, but can be configured during construction of the collection.- Returns:
- the value that represents null
-
push
void push(byte val)
Pushes the value onto the top of the stack.- Parameters:
val- anbytevalue
-
pop
byte pop()
Removes and returns the value at the top of the stack.- Returns:
- an
bytevalue
-
peek
byte peek()
Returns the value at the top of the stack.- Returns:
- an
bytevalue
-
size
int size()
Returns the current depth of the stack.
-
clear
void clear()
Clears the stack.
-
toArray
byte[] toArray()
Copies the contents of the stack into a native array. Note that this will NOT pop them out of the stack.- Returns:
- an
byte[]value
-
toArray
void toArray(byte[] dest)
Copies a slice of the list into a native array. Note that this will NOT pop them out of the stack.- Parameters:
dest- the array to copy into.
-
-