T
- public interface Stack<T> extends StackKernel<T>, java.lang.Iterable<T>
StackKernel
interface. All method implementations must, by design,
use only the StackKernel methods to perform operations on the component.Modifier and Type | Method and Description |
---|---|
boolean |
contains(T entry)
Reports whether
entry is in this . |
void |
flip()
Reverses the order of the entries in
this . |
T |
swapTop(T entry)
Replaces the entry at the top of
this with entry |
T |
top()
Returns a reference to, but does not remove, the top of
this . |
pop, push, size
clear, newInstance, transferFrom
void flip()
this
.T swapTop(T entry)
this
with entry
entry
- new top of the stack#this
swapTop = [top of#this
] and [top of#this
is replaced withentry
]
boolean contains(T entry)
entry
is in this
.entry
- entry to be looked forT top()
this
.