Package components.stack
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 class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, iterator, spliteratorMethods inherited from interface components.stack.StackKernel
length, pop, pushMethods inherited from interface components.standard.Standard
clear, newInstance, transferFrom
-
Constructor Details
-
StackSecondary
public StackSecondary()
-
-
Method Details
-
equals
-
hashCode
-
toString
-
top
Description copied from interface:StackReports the top ofthis. -
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
Description copied from interface:StackReverses ("flips")this.
-