private static void parseCommandLine(String[] args) { //Read parameters Stack<String> sargs=new Stack<String>(); for(String arg : args) { sargs.insertElementAt(arg, 0); } while(!sargs.empty()) { String argument=sargs.pop(); if(argument.contentEquals("-debug")) { DEBUG_MODE=true; } } }
private static void parseCommandLine(String[] args) { //Read parameters Stack<String> sargs = new Stack<String>(); for (String arg : args) { sargs.insertElementAt(arg, 0); } while (!sargs.empty()) { String argument = sargs.pop(); if (argument.contentEquals("--debug")) { debugMode = true; } else if(argument.contentEquals("--nofailmode")) { noFailMode = true; } } }
public Object push(Object item) { if (!(item instanceof XMLItem)) { throw new ClassCastException(item.getClass().getName()); } modified = true; if (items.size() > maxCapacity) { items.pop(); } items.remove(item); if (items.empty()) { items.add(item); } else { items.insertElementAt(item, 0); } fireListener(item); return item; }
public void eval(Stack stack) { float j = (Float) stack.pop(); float n = (Float) stack.pop(); // each sift consists of removing an element from the top of the // stack and inserting it between element n-1 and element n of the stack if (j > 0) { for (int i = 0; i < j; i++) { stack.insertElementAt(stack.lastElement(), (int) (stack.size() - (n))); // finish the move by poping the top; stack.pop(); } } // each shift consists of removing an element n-1 off the stack // and pushing it on top of the stack else if (j < 0) { for (int i = 0, max = (int) -j; i < max; i++) { stack.push(stack.remove((int) (stack.size() - (n)))); } } } };
Object dupx1 = stack.pop(); stack.push(dupx1); stack.insertElementAt(dupx1, stack.size() - 2); // Duplicate the top operand stack value and insert two values down break; case Opcodes.DUP_X2: