T
- public class StackSL<T> extends StackSecondary<T>
this = contents($this.rep) and this.top = $this.rep.entry(0)
Constructor and Description |
---|
StackSL() |
Modifier and Type | Method and Description |
---|---|
void |
clear()
Resets
this to its initial value. |
java.util.Iterator<T> |
iterator() |
StackSL<T> |
newInstance()
Returns a new object with the same dynamic type as
this , having
an initial value. |
T |
pop()
Removes the top of the stack and returns it.
|
void |
push(T entry)
Pushes
entry to the top of the stack. |
int |
size()
Reports the size of
this . |
void |
transferFrom(Stack<T> source)
Sets
this to the incoming value of source, and resets
source to an initial value; the declaration notwithstanding, the
dynamic type of source must be the same as the dynamic type of
this . |
public void push(T entry)
StackKernel
entry
to the top of the stack.entry
- entry to be pushed to the top of the stack.public T pop()
StackKernel
public int size()
StackKernel
this
.public void clear()
Standard
this
to its initial value.public java.util.Iterator<T> iterator()
public void transferFrom(Stack<T> source)
Standard
this
to the incoming value of source, and resets
source
to an initial value; the declaration notwithstanding, the
dynamic type of source
must be the same as the dynamic type of
this
. If the type T has a no-argument constructor, then
source
satisfies the contract of the no-argument constructor for
T. If T does not have a no-argument constructor, then source satisfies
the contract of the constructor call that was used to initialize
#source
.source
- object whose value is to be transferredpublic StackSL<T> newInstance()
Standard
this
, having
an initial value. If the type T has a no-argument constructor, then the
value of the new returned object satisfies the contract of the
no-argument constructor for T. If T does not have a no-argument
constructor, then the value of the new returned object satisfies the
contract of the constructor call that was used to initialize
this
.this
with an initial value