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:StackInterfaceAdds a new entry to the top of this stack.- Specified by:
pushin interfaceStackInterface<T>- Parameters:
newEntry- element to be added to the stack
-
pop
Description copied from interface:StackInterfaceRemoves and returns this stack's top entry. The size of the stack is decreased by one.- Specified by:
popin interfaceStackInterface<T>- Returns:
- The element at the top of the stack.
-
peek
Description copied from interface:StackInterfaceGet this stack's top entry. The size of the stack is not changed.- Specified by:
peekin interfaceStackInterface<T>- Returns:
- The element at the top of the stack.
-
isEmpty
public boolean isEmpty()Description copied from interface:StackInterfaceDetermines if there are any elements in the stack.- Specified by:
isEmptyin interfaceStackInterface<T>- Returns:
- True if the stack is empty.
-
clear
public void clear()Description copied from interface:StackInterfaceRemoves all entries from the stack.- Specified by:
clearin interfaceStackInterface<T>
-