Class ArrayReverseStack<T>
java.lang.Object
ArrayReverseStack<T>
- All Implemented Interfaces:
StackInterface<T>
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
DEFAULT_INITIAL_CAPACITY
public static final int DEFAULT_INITIAL_CAPACITY- See Also:
-
-
Constructor Details
-
ArrayReverseStack
public ArrayReverseStack()
-
-
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>
-