budget/src/main/java/budget/backend/structures/LimitedStack.java
public int search(E o)
  {
    int ret = 1;
    for (E e : stack)
    {
      if (e.equals(o)) 
        return ret;
      ret++;
    }
    return -1;

  }
/**
   * Returns the 1-based position where an object is on this stack. If the object
   * o occurs as an item in this stack, this method returns the distance from the
   * top of the stack of the occurrence nearest the top of the stack; the topmost
   * item on the stack is considered to be at distance 1. The equals method is
   * used to compare o to the items in this stack.
   * 
   * @param o
   * @return the 1-based position from the top of the stack where the object is
   *         located; the return value -1 indicates that the object is not on the
   *         stack.
   */
Returns the 1-based position where an object is on this stack. If the object
o occurs as an item in this stack, this method returns the distance from the
top of the stack of the occurrence nearest the top of the stack; the topmost
item on the stack is considered to be at distance 1. The equals method is
used to compare o to the items in this stack.

@param o
@return the 1-based position from the top of the stack where the object is
located; the return value -1 indicates that the object is not on the
stack.
Returns the 1 - based position where an object is on this stack . If the object o occurs as an item in this stack this method returns the distance from the top of the stack of the occurrence nearest the top of the stack ; the topmost item on the stack is considered to be at distance 1 . The equals method is used to compare o to the items in this stack . @param o @return the 1 - based position from the top of the stack where the object is located ; the return value - 1 indicates that the object is not on the stack .
public int search(E o)
  {
    int ret = 1;
    for (E e : stack)
    {
      if (e.equals(o)) 
        return ret;
      ret++;
    }
    return -1;
  }
public int search ( E o ) { int ret = 1 ; for ( E e : stack ) { if ( e . equals ( o ) ) return ret ; ret ++ ; } return - 1 ; }
Returns the 1-based position where an object is on this stack.
Returns the 1 - based position where an object is on this stack .