public final class IntStack extends Object
Modifier and Type | Field and Description |
---|---|
int[] |
array |
int |
currentIndex |
MemoryPool |
pool |
Constructor and Description |
---|
IntStack(MemoryPool pool) |
Modifier and Type | Method and Description |
---|---|
void |
clear() |
boolean |
isEmpty() |
int |
peek()
returns, without removing, the top element
|
int |
pop()
returns the top of the stack and removes it from the stack
|
void |
push(int n)
pushes the int on the stack
|
int |
size() |
String |
toString() |
public int[] array
public int currentIndex
public MemoryPool pool
public IntStack(MemoryPool pool)
public void clear()
public boolean isEmpty()
public int size()
public void push(int n)
n
- the element to pushpublic int pop()
public int peek()
Copyright © 2022. All rights reserved.