Code example for Deque

Methods: addLast

0
        if (count == 2) {
            st.nextToken();
            String paramOrNumber = st.nextToken();
            try { 
                Double number = Double.parseDouble(paramOrNumber);
                stack.addLast(number);
            } catch (NumberFormatException e) {
                if (map.containsKey(paramOrNumber)) {
                    stack.addLast(map.get(paramOrNumber));
                } else { 
                    throw new CalcCommandsException(this.getClass().getSimpleName() + ".exec(" + inCommand + ") fail! Parameter " + paramOrNumber + " not defined!");
                } 
            } 
        } 
    } 
}