|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--gishur.core.BasicList | +--gishur.core.Stack
A simple stack based upon BasicList
.
BasicList
, Serialized FormFields inherited from class gishur.core.BasicList |
ANY_ACCESS, KEY, LISTITEM, NO_ACCESS, VALUE |
Fields inherited from interface gishur.core.ControlledCloneable |
DEEP, FLAT |
Constructor Summary | |
Stack()
Empty constructor calling BasicList.BasicList() . |
Method Summary | |
java.lang.Object |
bottom()
Retunrs the lower (first) element of the Stack . |
void |
clear()
Clears the whole Stack . |
java.lang.Object |
clone()
Implementation of gishur.core.Cloneable clones the entire list by cloning the contained data-/keyobjects, if possible. |
java.lang.Object |
clone(java.util.Hashtable h,
int level)
clones the entire list according to gishur.core.ControlledClonebale . |
boolean |
contains(java.lang.Object object)
Returns true if this Stack contains
object . |
java.lang.Object[] |
convertToArray()
Converts the Stack into an array. |
java.util.Enumeration |
elements()
Returns a java.util.Enumeration -object enumerating the
Stack's elements. |
boolean |
empty()
Returns true if the Stack is empty. |
ListView |
getListView()
Creates a ListView -object enabling complete read access to
the Stack without knowing its explicite type. |
int |
length()
Returns the number of stored elements in the Stack . |
java.lang.Object |
peek()
Works the same way like top() . |
java.lang.Object |
pop()
Removes the last element from the Stack and returns it.
|
boolean |
popBoolean()
pop() for boolean -values. |
double |
popDouble()
pop() for double -values. |
float |
popFloat()
pop() for float -values. |
int |
popInt()
pop() for int -values. |
long |
popLong()
pop() for long -values. |
void |
push(boolean b)
push(java.lang.Object) for boolean -values. |
void |
push(double d)
push(java.lang.Object) for double -values. |
void |
push(float f)
push(java.lang.Object) for float -values. |
void |
push(int i)
push(java.lang.Object) for int -values. |
void |
push(long l)
push(java.lang.Object) for long -values. |
void |
push(java.lang.Object object)
Stores an object on the stack. |
java.lang.Object |
top()
Returns the upper (last) elements of the Stack . |
java.lang.String |
toString()
Overrides java.lang.Object.toString() . |
Methods inherited from class gishur.core.BasicList |
add, add, allowAccess, contains, copy, copy, copy, cut, cycle, cycle, enumerate, equals, find, findClass, findClosest, first, getDistance, getIndex, getListItem, getListItemArray, getListString, last, move, reconnect, reconnect, remove, requestAccess, reverse, storeInArray, toString, unconnect |
Methods inherited from class java.lang.Object |
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public Stack()
BasicList.BasicList()
.Method Detail |
public java.lang.String toString()
java.lang.Object.toString()
.toString
in class BasicList
Object.toString()
public java.lang.Object clone()
clone
in interface Cloneable
clone
in class java.lang.Object
this
object.InternalError
- - if the Object could not be cloned properlypublic java.lang.Object clone(java.util.Hashtable h, int level)
gishur.core.ControlledClonebale
. That means,
all ListItems
are cloned and connected proper.level
see also ControlledCloneable
clone
in interface ControlledCloneable
clone
in class BasicList
h
- Hashtable to indicate which objects are already cloned (see also: ControlledCloneable
)level
- indicates how deep the objects should be cloned (see also: ControlledCloneable
)InternalError
- - if the Object could not be cloned properlypublic int length()
Stack
.length
in class BasicList
public boolean empty()
true
if the Stack
is empty.empty
in class BasicList
true
if Stack
is emptypublic boolean contains(java.lang.Object object)
true
if this Stack
contains
object
.object
- the object to search for in the Stack
true
, if object
is part of this stackpublic java.lang.Object bottom()
Stack
. If the Stack
is empty, a ListException
will occur.Stack's
first elementpublic java.lang.Object top()
Stack
. If the Stack
is empty, a ListException
will occur.Stack's
last elementpublic java.lang.Object peek()
top()
.Stack's
last elementtop()
public void push(java.lang.Object object)
object
- to push onto the stackpublic java.lang.Object pop()
Stack
and returns it.
The last element is that one which was last added to the Stack
.Stack's
last elementpublic void clear()
Stack
.clear
in class BasicList
public java.lang.Object[] convertToArray()
Stack
into an array. The lowest (first) element of the
Stack
will be the array's first element.Object
containing the
Stack's
objects in their former orderpublic java.util.Enumeration elements()
java.util.Enumeration
-object enumerating the
Stack's
elements. The Stack's
lowest (first)
element will be the first element of the Enumeration
and so on.Enumeration
enumerating this Stack
public ListView getListView()
ListView
-object enabling complete read access to
the Stack
without knowing its explicite type.getListView
in class BasicList
ListView
for read accesspublic void push(int i)
push(java.lang.Object)
for int
-values.i
- the int
to be pushed onto the Stack
push(java.lang.Object)
public void push(long l)
push(java.lang.Object)
for long
-values.l
- the long
to be pushed onto the Stack
push(java.lang.Object)
public void push(float f)
push(java.lang.Object)
for float
-values.f
- the float
to be pushed onto the Stack
push(java.lang.Object)
public void push(double d)
push(java.lang.Object)
for double
-values.d
- the double
to be pushed onto the Stack
push(java.lang.Object)
public void push(boolean b)
push(java.lang.Object)
for boolean
-values.i
- the boolean
to be pushed onto the Stack
push(java.lang.Object)
public int popInt()
pop()
for int
-values. If the object on top the
Stack
cannot be converted into an int
, a
ListException
will occur.Stack's
last object as an int
-valuepop()
public long popLong()
pop()
for long
-values. If the object on top the
Stack
cannot be converted into a long
, a
ListException
will occur.Stack's
last object as an long
-valuepop()
public float popFloat()
pop()
for float
-values. If the object on top the
Stack
cannot be converted into a flaot
, a
ListException
will occur.Stack's
last object as an float
-valuepop()
public double popDouble()
pop()
for double
-values. If the object on top the
Stack
cannot be converted into a double
, a
ListException
will occur.Stack's
last object as an double
-valuepop()
public boolean popBoolean()
pop()
for boolean
-values. If the object on top the
Stack
cannot be converted into a boolean
, a
ListException
will occur.Stack's
last object as an boolean
-valuepop()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |