Package java.util

Examples of java.util.EmptyStackException


    try {
      return m_map[m_firstFree - 1];
    }
    catch (ArrayIndexOutOfBoundsException e)
    {
      throw new EmptyStackException();
    }
  }
View Full Code Here


    try {
      return m_map[m_firstFree-(1+n)];
    }
    catch (ArrayIndexOutOfBoundsException e)
    {
      throw new EmptyStackException();
    }
  }
View Full Code Here

        ArrayStack namedStack = (ArrayStack) stacksByName.get(stackName);
        if (namedStack == null) {
            if (log.isDebugEnabled()) {
                log.debug("Stack '" + stackName + "' is empty");
            }
            throw new EmptyStackException();
           
        } else {
       
            result = namedStack.pop();
        }
View Full Code Here

        ArrayStack namedStack = (ArrayStack) stacksByName.get(stackName);
        if (namedStack == null ) {
            if (log.isDebugEnabled()) {
                log.debug("Stack '" + stackName + "' is empty");
            }       
            throw new EmptyStackException();
       
        } else {
       
            result = namedStack.peek();
        }
View Full Code Here

   * @exception EmptyStackException
   *                when empty.
   */
  public int peek() {
    if (size == 0)
      throw new EmptyStackException();
    return list[size - 1];
  }
View Full Code Here

     */
    public Object peek() throws EmptyStackException {

        int n = size();
        if (n <= 0)
            throw new EmptyStackException();
        else
            return (get(n - 1));

    }
View Full Code Here

     */
    public Object peek(int n) throws EmptyStackException {

        int m = (size() - n) - 1;
        if (m < 0)
            throw new EmptyStackException();
        else
            return (get(m));

    }
View Full Code Here

     */
    public Object pop() throws EmptyStackException {

        int n = size();
        if (n <= 0)
            throw new EmptyStackException();
        else
            return (remove(n - 1));

    }
View Full Code Here

     */
  public void popContext ()
  {
    _contextPos--;
    if (_contextPos < 0) {
      throw new EmptyStackException();
    }
    _currentContext = _contexts[_contextPos];
  }
View Full Code Here

        ArrayStack namedStack = (ArrayStack) stacksByName.get(stackName);
        if (namedStack == null) {
            if (log.isDebugEnabled()) {
                log.debug("Stack '" + stackName + "' is empty");
            }
            throw new EmptyStackException();
        }
       
        result = namedStack.pop();
       
        if (stackAction != null) {
View Full Code Here

TOP

Related Classes of java.util.EmptyStackException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.