|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sourceforge.webcompmath.data.StackOfDouble
public class StackOfDouble
A standard stack of values of type double, which can grow to arbitrary size.
| Constructor Summary | |
|---|---|
StackOfDouble()
Create an initially empty stack. |
|
StackOfDouble(int initialSize)
Create an empty stack that initially has space for initialSize items pre-allocated. |
|
| Method Summary | |
|---|---|
boolean |
isEmpty()
Return true if and only if the stack contains no items. |
void |
makeEmpty()
Clear all items from the stack. |
double |
pop()
Remove and return the top item on the stack. |
void |
push(double x)
Add x to top of stack. |
int |
size()
Return the number of items on the stack. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public StackOfDouble()
public StackOfDouble(int initialSize)
initialSize - number of items to initially allow space for| Method Detail |
|---|
public void push(double x)
x - value to add to stackpublic double pop()
public boolean isEmpty()
public void makeEmpty()
public int size()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||