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

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

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

Stack.addElement介绍

暂无

代码示例

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

  1. /**
  2. * Pushes the specified object onto the top of the stack.
  3. *
  4. * @param object
  5. * The object to be added on top of the stack.
  6. * @return the object argument.
  7. * @see #peek
  8. * @see #pop
  9. */
  10. public E push(E object) {
  11. addElement(object);
  12. return object;
  13. }

代码示例来源:origin: belerweb/pinyin4j

  1. /** Create an XPath from some steps. steps.lenght must be >= 1 */
  2. private XPath(boolean isAbsolute, Step[] steps) {
  3. for (int i = 0; i < steps.length; ++i)
  4. steps_.addElement(steps[i]);
  5. absolute_ = isAbsolute;
  6. string_ = null;
  7. }

代码示例来源:origin: MobiVM/robovm

  1. /**
  2. * Pushes the specified object onto the top of the stack.
  3. *
  4. * @param object
  5. * The object to be added on top of the stack.
  6. * @return the object argument.
  7. * @see #peek
  8. * @see #pop
  9. */
  10. public E push(E object) {
  11. addElement(object);
  12. return object;
  13. }

代码示例来源:origin: ibinti/bugvm

  1. /**
  2. * Pushes the specified object onto the top of the stack.
  3. *
  4. * @param object
  5. * The object to be added on top of the stack.
  6. * @return the object argument.
  7. * @see #peek
  8. * @see #pop
  9. */
  10. public E push(E object) {
  11. addElement(object);
  12. return object;
  13. }

代码示例来源:origin: com.belerweb/pinyin4j

  1. /** Create an XPath from some steps. steps.lenght must be >= 1 */
  2. private XPath(boolean isAbsolute, Step[] steps) {
  3. for (int i = 0; i < steps.length; ++i)
  4. steps_.addElement(steps[i]);
  5. absolute_ = isAbsolute;
  6. string_ = null;
  7. }

代码示例来源:origin: com.mobidevelop.robovm/robovm-rt

  1. /**
  2. * Pushes the specified object onto the top of the stack.
  3. *
  4. * @param object
  5. * The object to be added on top of the stack.
  6. * @return the object argument.
  7. * @see #peek
  8. * @see #pop
  9. */
  10. public E push(E object) {
  11. addElement(object);
  12. return object;
  13. }

代码示例来源:origin: org.apache.vxquery/apache-vxquery-core

  1. /**
  2. * Push the current state onto the state stack.
  3. */
  4. private void pushState()
  5. {
  6. stateStack.addElement(curLexState);
  7. }

代码示例来源:origin: org.apache.openwebbeans/openwebbeans-impl

  1. public void pushError(Throwable e)
  2. {
  3. errorStack.addElement(e);
  4. }

代码示例来源:origin: com.gluonhq/robovm-rt

  1. /**
  2. * Pushes the specified object onto the top of the stack.
  3. *
  4. * @param object
  5. * The object to be added on top of the stack.
  6. * @return the object argument.
  7. * @see #peek
  8. * @see #pop
  9. */
  10. public E push(E object) {
  11. addElement(object);
  12. return object;
  13. }

代码示例来源:origin: org.apache.jackrabbit/jackrabbit-spi-commons

  1. /**
  2. * Push the current state onto the state stack.
  3. */
  4. private void pushState()
  5. {
  6. // System.err.println("pushing: "+curLexState); printLinePos();
  7. stateStack.addElement(new Integer(curLexState));
  8. }

代码示例来源:origin: org.xmlbeam/xmlprojector

  1. /**
  2. * Push the current state onto the state stack.
  3. */
  4. private void pushState()
  5. {
  6. stateStack.addElement(new Integer(curLexState));
  7. }

代码示例来源:origin: apache/jackrabbit

  1. /**
  2. * Push the current state onto the state stack.
  3. */
  4. private void pushState()
  5. {
  6. // System.err.println("pushing: "+curLexState); printLinePos();
  7. stateStack.addElement(new Integer(curLexState));
  8. }

代码示例来源:origin: org.glassfish.main.persistence.cmp/cmp-enhancer

  1. private final void copyStack(Stack fromStack, Stack toStack) {
  2. while (!toStack.empty())
  3. toStack.pop();
  4. // take advantage of Stack's inheritance from Vector
  5. for (int i=0; i<fromStack.size(); i++)
  6. toStack.addElement(fromStack.elementAt(i));
  7. }

代码示例来源:origin: org.apache.airavata/messenger-commons

  1. public synchronized void free(Connection connection) {
  2. busyConnections.removeElement(connection);
  3. availableConnections.addElement(connection);
  4. // Wake up threads that are waiting for a connection
  5. notifyAll();
  6. }

代码示例来源:origin: org.apache.airavata/airavata-registry-service

  1. public synchronized void free(Connection connection) {
  2. busyConnections.removeElement(connection);
  3. availableConnections.addElement(connection);
  4. // Wake up threads that are waiting for a connection
  5. notifyAll();
  6. }

代码示例来源:origin: org.apache.airavata/airavata-api-server

  1. public synchronized void free(Connection connection) {
  2. busyConnections.removeElement(connection);
  3. availableConnections.addElement(connection);
  4. // Wake up threads that are waiting for a connection
  5. notifyAll();
  6. }

代码示例来源:origin: org.apache.airavata/airavata-messenger-commons

  1. public synchronized void free(Connection connection) {
  2. busyConnections.removeElement(connection);
  3. availableConnections.addElement(connection);
  4. // Wake up threads that are waiting for a connection
  5. notifyAll();
  6. }

代码示例来源:origin: com.l2fprod.common/l2fprod-common-directorychooser

  1. public void add(WindowsDirectoryChooserUI.FileTreeNode node, JTree tree) {
  2. if (!isAlive()) {
  3. throw new IllegalArgumentException("Queue is no longer alive");
  4. }
  5. synchronized (lock) {
  6. if (running) {
  7. nodes.addElement(new QueueItem(node, tree));
  8. lock.notifyAll();
  9. }
  10. }
  11. }

代码示例来源:origin: secure-software-engineering/soot-infoflow

  1. public void concreteWriteReadStackGetTest() {
  2. String tainted = TelephonyManager.getDeviceId();
  3. Stack<String> stack = new Stack<String>();
  4. stack.addElement("neutral");
  5. stack.push(tainted);
  6. String taintedElement2 = stack.get(0);
  7. ConnectionManager cm = new ConnectionManager();
  8. cm.publish(taintedElement2);
  9. }

代码示例来源:origin: secure-software-engineering/soot-infoflow

  1. public void concreteWriteReadStackPeekTest() {
  2. String tainted = TelephonyManager.getDeviceId();
  3. Stack<String> stack = new Stack<String>();
  4. stack.addElement("neutral");
  5. stack.push(tainted);
  6. String taintedElement = stack.peek();
  7. ConnectionManager cm = new ConnectionManager();
  8. cm.publish(taintedElement);
  9. }

相关文章