stack
Class StackDinamico<E>

java.lang.Object
  extended by stack.StackDinamico<E>
All Implemented Interfaces:
Stack<E>

public class StackDinamico<E>
extends java.lang.Object
implements Stack<E>


Constructor Summary
StackDinamico()
          Creates an empty Stack
 
Method Summary
 boolean empty()
          Tests if this stack is empty.
 boolean equals(java.lang.Object o)
           
 int howMany()
          Returns the number of elements inside the Stack.
 E peek()
          Looks at the object at the top of this stack without removing it from the stack.
 E pop()
          Removes the object at the top of this stack and returns that object as the value of this function.
 E push(E item)
          Pushes an item onto the top of this stack.
 int search(E o)
          Returns the 1-based position where an object is on this stack.
 java.lang.String toString()
          Return a String representation of the Stack and its content.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

StackDinamico

public StackDinamico()
Creates an empty Stack

Method Detail

empty

public boolean empty()
Tests if this stack is empty.

Specified by:
empty in interface Stack<E>

peek

public E peek()
Looks at the object at the top of this stack without removing it from the stack.

Specified by:
peek in interface Stack<E>

pop

public E pop()
Removes the object at the top of this stack and returns that object as the value of this function.

Specified by:
pop in interface Stack<E>

push

public E push(E item)
Pushes an item onto the top of this stack.

Specified by:
push in interface Stack<E>

search

public int search(E o)
Returns the 1-based position where an object is on this stack.

Specified by:
search in interface Stack<E>

howMany

public int howMany()
Returns the number of elements inside the Stack.

Specified by:
howMany in interface Stack<E>

toString

public java.lang.String toString()
Return a String representation of the Stack and its content.

Overrides:
toString in class java.lang.Object

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object