Class StackSecondary<T>
java.lang.Object
components.stack.StackSecondary<T>
- Type Parameters:
T- type ofStackentries
- All Implemented Interfaces:
Stack<T>, StackKernel<T>, Standard<Stack<T>>, Iterable<T>
Layered implementations of secondary methods for
Stack.
Execution-time performance of flip implemented in this class is O(|
this|).
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from interface Iterable
forEach, iterator, spliteratorMethods inherited from interface StackKernel
length, pop, pushMethods inherited from interface Standard
clear, newInstance, transferFrom
-
Constructor Details
-
StackSecondary
public StackSecondary()
-
-
Method Details
-
equals
-
hashCode
-
toString
-
top
-
replaceTop
Description copied from interface:StackReplaces the top ofthiswithx, and returns the old top.- Specified by:
replaceTopin interfaceStack<T>- Parameters:
x- the new top entry- Returns:
- the old top entry
-
flip
-