java.util.Stack.insertElementAt()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(2.1k)|赞(0)|评价(0)|浏览(157)

本文整理了Java中java.util.Stack.insertElementAt()方法的一些代码示例,展示了Stack.insertElementAt()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Stack.insertElementAt()方法的具体详情如下:
包路径:java.util.Stack
类名称:Stack
方法名:insertElementAt

Stack.insertElementAt介绍

暂无

代码示例

代码示例来源:origin: org.orbisgis/orbisgis-view

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;
    }
  }
}

代码示例来源:origin: orbisgis/orbisgis

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;
    }
  }
}

代码示例来源:origin: org.microemu/microemu-javase

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;
}

代码示例来源:origin: org.icepdf.os/icepdf-core

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))));
      }
    }
  }
};

代码示例来源:origin: net.sf.jiapi/jiapi-reflect

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:

相关文章