![]() |
AuD
Lecture 'Algorithmen und Datenstrukturen' (code examples)
|
Interface for an ADT stack. More...
Public Member Functions | |
abstract boolean | is_empty () |
Is stack empty? More... | |
abstract T | top () |
Get stack top. More... | |
abstract T | pop () |
Pop element from stack. More... | |
abstract void | push (T x) |
Push x onto stack. More... | |
String | toString () |
Get string representation "|a|b|c" . More... | |
Protected Member Functions | |
AbstractStack () | |
create empty stack More... | |
Interface for an ADT stack.
Definition at line 8 of file AbstractStack.java.
|
protected |
|
abstract |
Is stack empty?
Reimplemented in aud.Stack< T >.
Referenced by aud.adt.AbstractStack< T >.toString().
|
abstract |
Pop element from stack.
Requires !is_empty()
.
NoSuchElementException |
Reimplemented in aud.example.VerboseStack< T >, and aud.Stack< T >.
Referenced by aud.adt.AbstractStack< T >.toString().
|
abstract |
Push x onto stack.
x | new element |
Reimplemented in aud.example.VerboseStack< T >, and aud.Stack< T >.
Referenced by aud.adt.AbstractStack< T >.toString().
|
abstract |
Get stack top.
Requires !is_empty()
.
NoSuchElementException |
Reimplemented in aud.Stack< T >.
String aud.adt.AbstractStack< T >.toString | ( | ) |
Get string representation "|a|b|c"
.
(Here, "c"
is stack top. "|"
denotes empty stack.)
Reimplemented in aud.example.VerboseStack< T >.
Definition at line 40 of file AbstractStack.java.
References aud.adt.AbstractStack< T >.is_empty(), aud.adt.AbstractStack< T >.pop(), aud.adt.AbstractStack< T >.push(), and aud.adt.AbstractStack< T >.toString().
Referenced by aud.adt.AbstractStack< T >.toString().