Class StackInfinitePush<T>
java.lang.Object
StackInfinitePush<T>
- All Implemented Interfaces:
StackInterface<T>
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
StackInfinitePush
public StackInfinitePush(int capacity)
-
-
Method Details
-
push
Description copied from interface:StackInterface
Adds a new entry to the top of this stack.- Specified by:
push
in interfaceStackInterface<T>
- Parameters:
newEntry
- element to be added to the stack
-
pop
Description copied from interface:StackInterface
Removes and returns this stack's top entry. The size of the stack is decreased by one.- Specified by:
pop
in interfaceStackInterface<T>
- Returns:
- The element at the top of the stack.
-
peek
Description copied from interface:StackInterface
Get this stack's top entry. The size of the stack is not changed.- Specified by:
peek
in interfaceStackInterface<T>
- Returns:
- The element at the top of the stack.
-
isEmpty
public boolean isEmpty()Description copied from interface:StackInterface
Determines if there are any elements in the stack.- Specified by:
isEmpty
in interfaceStackInterface<T>
- Returns:
- True if the stack is empty.
-
clear
public void clear()Description copied from interface:StackInterface
Removes all entries from the stack.- Specified by:
clear
in interfaceStackInterface<T>
-