public class Stack
extends java.util.ArrayList
Stack
class provides the functions of a stack.
title: SystemCoreLib
description: SystemCoreLib
copyright: (c) 2013 thomas kaffka, born at 11/08/1959 in düsseldorf - germany , all rights reserved.
Constructor and Description |
---|
Stack()
The constructor
Stack creates a new instance(object) of the class. |
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
getTopOfStack()
The method
getTopOfStack gets the object on the top of the stack. |
boolean |
hasObjects()
The method
hasObjects evaluates, if the stack has objects. |
boolean |
isObject(java.lang.Object obj)
The method
isObject checks, if the object is in the stack. |
java.lang.Object |
pop()
The method
pop gets the top object from the stack
and eliminates the object on the top of the stack. |
void |
push(java.lang.Object obj)
The method
push puts the object on the top of the stack. |
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, forEach, get, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSize
public Stack()
Stack
creates a new instance(object) of the class.public boolean hasObjects()
hasObjects
evaluates, if the stack has objects.public boolean isObject(java.lang.Object obj)
isObject
checks, if the object is in the stack.obj
- an object.public void push(java.lang.Object obj)
push
puts the object on the top of the stack.obj
- the object to put.public java.lang.Object getTopOfStack()
getTopOfStack
gets the object on the top of the stack.public java.lang.Object pop()
pop
gets the top object from the stack
and eliminates the object on the top of the stack.