Package panda.utilities.collection
Class FixedStack<T>
java.lang.Object
panda.utilities.collection.FixedStack<T>
- All Implemented Interfaces:
IStack<T>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Clear the stackbooleanisEmpty()Tests if stack is emptypeek()Check element on top of the stackpop()Removes the object at the top of this stack and returns that object as the valuevoidPushes an item onto the top of this stackintsize()Returns the number of items in this stackfinal T[]Converts stack into the array, ordered by the push order (the latest items are the first in array)
-
Constructor Details
-
FixedStack
public FixedStack(int size)
-
-
Method Details
-
push
Description copied from interface:IStackPushes an item onto the top of this stack -
peek
Description copied from interface:IStackCheck element on top of the stack -
pop
Description copied from interface:IStackRemoves the object at the top of this stack and returns that object as the value -
size
public int size()Description copied from interface:IStackReturns the number of items in this stack -
isEmpty
public boolean isEmpty()Description copied from interface:IStackTests if stack is empty -
clear
public void clear()Description copied from interface:IStackClear the stack -
toArray
Description copied from interface:IStackConverts stack into the array, ordered by the push order (the latest items are the first in array)
-