Package gnu.trove.stack
Interface TDoubleStack
- All Known Implementing Classes:
TDoubleArrayStack
public interface TDoubleStack
A stack of double primitives.
-
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Clears the stack.doubleReturns the value that is used to represent null.doublepeek()Returns the value at the top of the stack.doublepop()Removes and returns the value at the top of the stack.voidpush(double val) Pushes the value onto the top of the stack.intsize()Returns the current depth of the stack.double[]toArray()Copies the contents of the stack into a native array.voidtoArray(double[] dest) Copies a slice of the list into a native array.
-
Method Details
-
getNoEntryValue
double 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(double val) Pushes the value onto the top of the stack.- Parameters:
val- andoublevalue
-
pop
double pop()Removes and returns the value at the top of the stack.- Returns:
- an
doublevalue
-
peek
double peek()Returns the value at the top of the stack.- Returns:
- an
doublevalue
-
size
int size()Returns the current depth of the stack. -
clear
void clear()Clears the stack. -
toArray
double[] toArray()Copies the contents of the stack into a native array. Note that this will NOT pop them out of the stack.- Returns:
- an
double[]value
-
toArray
void toArray(double[] 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.
-