public class IntegerStack extends Object
AbstractJiffleRuntime
.
This class is here to avoid using generic collections (which the Janino compiler
does not support) or littering the runtime source code with casts.Modifier and Type | Field and Description |
---|---|
static int |
CHUNK_SIZE
Initial size of stack and grow increment
|
static int |
CLEAR_SIZE
Stack size beyond which the data array will be shrunk
when
clear() is called. |
Constructor and Description |
---|
IntegerStack() |
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clear the stack.
|
Integer |
peek()
Peek at the top value without removing it.
|
Integer |
pop()
Pop the top value off the stack.
|
Integer |
push(Integer x)
Push a value onto the stack.
|
int |
size()
Gets the number of items on the stack.
|
public static final int CHUNK_SIZE
public static final int CLEAR_SIZE
clear()
is called.public Integer push(Integer x)
x
- the valuepublic Integer pop()
RuntimeException
- if the stack is emptypublic Integer peek()
RuntimeException
- if the stack is emptypublic void clear()
CLEAR_SIZE
the data array is shrunk to its initial size.public int size()
Copyright © 2006–2018 GeoSolutions. All rights reserved.