|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectscranton.Linear1
scranton.Linear1Ind
scranton.stack.StackViaLinear1Ind
An implementation of the Stack interface via extension of the Linear1Ind class. Invariant: The class warranty is voided is a client directly applies any Linear1Ind class method.
| Field Summary |
| Fields inherited from class scranton.Linear1 |
data, link |
| Constructor Summary | |
|
StackViaLinear1Ind()
Constructs an empty stack by extending the Linear1Indclass. |
protected |
StackViaLinear1Ind(java.lang.Object obj)
This constructor is for use by extensions of this class. |
| Method Summary | |
Linear1 |
factory()
Returns a null Linear1() object |
boolean |
isEmpty()
Stack does not change, returns true iff the stack is empty. |
java.lang.Object |
pop()
Decrease the size of the stack by one by removing and returning the object at the top. |
void |
push(java.lang.Object item)
Increase the size of the stack by one by placing item as the new top of the stack. |
java.lang.Object |
topOf()
Stack does not change, returns the reference to the top object in the stack. |
java.lang.String |
toString()
Returns a string representation of the stack. |
| Methods inherited from class scranton.Linear1Ind |
indInsert, indRemove, indReplace, indView |
| Methods inherited from class scranton.Linear1 |
getData, getLink, setData, setLink |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public StackViaLinear1Ind()
protected StackViaLinear1Ind(java.lang.Object obj)
| Method Detail |
public boolean isEmpty()
Stack
|
S'=S Return S==() |
isEmpty in interface Stackpublic java.lang.Object topOf()
Stack
|
S!=() S'=S Return an-1 |
topOf in interface Stackpublic void push(java.lang.Object item)
Stack
| S'=(S, obj) |
push in interface Stackitem - The new top of stackpublic java.lang.Object pop()
Stack
|
S!=() S = (S', an-1) Return: an-1 |
pop in interface Stackpublic Linear1 factory()
Linear1
factory in class Linear1public java.lang.String toString()
Stack
toString in interface StacktoString in class Linear1Ind
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||