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

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

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

Stack.set介绍

暂无

代码示例

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

  1. stack.set(stack.size() - 1, stack.peek() - 2 + 1);
  2. break;
  3. case FUNCTION:
  4. stack.set(stack.size() - 1, stack.peek() + 1);
  5. break;
  6. case OPEN_PAREN:
  7. break;
  8. default:
  9. stack.set(stack.size() - 1, stack.peek() + 1);

代码示例来源:origin: apache/uima-uimaj

  1. stack.set(mylevel, null);

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

  1. /**
  2. This is kind of crazy, but used by the setNameSpace command.
  3. zero based.
  4. */
  5. public synchronized void set(int depth, NameSpace ns) {
  6. stack.set( stack.size()-1-depth, ns );
  7. }

代码示例来源:origin: org.apache.uima/jVinci

  1. stack.set(mylevel, null);

代码示例来源:origin: jitlogic/zorka

  1. /**
  2. This is kind of crazy, but used by the setNameSpace command.
  3. zero based.
  4. */
  5. public void set(int depth, NameSpace ns) {
  6. stack.set( stack.size()-1-depth, ns );
  7. }

代码示例来源:origin: org.xwiki.rendering/xwiki-rendering-syntax-xwiki10

  1. public void setType(HTMLType type)
  2. {
  3. this.type.set(this.type.size() - 1, type);
  4. }

代码示例来源:origin: org.apache.abdera/abdera-extensions-json

  1. private boolean isStart() {
  2. boolean b = sepstack.peek();
  3. if (b) {
  4. sepstack.set(sepstack.size() - 1, false);
  5. }
  6. return b;
  7. }

代码示例来源:origin: jitlogic/zorka

  1. /**
  2. Swap in the value as the new top of the stack and return the old
  3. value.
  4. */
  5. public NameSpace swap( NameSpace newTop ) {
  6. int last = stack.size() - 1;
  7. NameSpace oldTop = stack.get(last);
  8. stack.set( last, newTop );
  9. return oldTop;
  10. }

代码示例来源:origin: hawkular/hawkular-agent

  1. private void indent() throws XMLStreamException {
  2. delegate.writeCharacters(NEW_LINE, 0, 1);
  3. for (int i = 0; i < indent; i++) {
  4. delegate.writeCharacters(SPACE, 0, 1);
  5. }
  6. indent += INDENT_SIZE;
  7. if (!stack.empty()) {
  8. stack.set(stack.size() - 1, Boolean.TRUE);
  9. }
  10. stack.push(Boolean.FALSE);
  11. }

代码示例来源:origin: org.wikimodel/org.wikimodel.wem

  1. public void setScannerContext(WikiScannerContext context) {
  2. if (fScannerContext.isEmpty()) {
  3. pushScannerContext(context);
  4. } else {
  5. fScannerContext.set(fScannerContext.size() - 1, context);
  6. }
  7. }

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

  1. @Override
  2. public void setValueInScope(Object scope, String name, Collection coll) {
  3. int index = ((Integer) scope).intValue();
  4. if (index >= 0) {
  5. Map currValues = (Map) scopes.get(index);
  6. currValues.put(cutoffPre(name), coll);
  7. scopes.set(index, currValues);
  8. } else
  9. log.warn("Cannot set value for variable '" + name + "', because " +
  10. "couldn't find scope.");
  11. }

代码示例来源:origin: org.apache.pulsar/pulsar-broker

  1. private void checkSeparator() {
  2. if (separators.isEmpty()) {
  3. return;
  4. } else if (separators.peek() == Boolean.TRUE) {
  5. write(",");
  6. } else {
  7. separators.set(separators.size() - 1, Boolean.TRUE);
  8. }
  9. }
  10. }

代码示例来源:origin: net.e6tech/elements-persist

  1. public static void addGracePeriod(long time) {
  2. if (!logger.isDebugEnabled())
  3. return;
  4. Stack<Long> stack = gracePeriod.get();
  5. if (stack == null)
  6. return;
  7. for (int i = 0; i < stack.size(); i++) {
  8. long existing = stack.get(i);
  9. stack.set(i, existing + time);
  10. }
  11. }

代码示例来源:origin: org.appdapter/ext.bundle.math.symja_jas

  1. /** {@inheritDoc} */
  2. public void set(final IExpr value) {
  3. final Stack<IExpr> localVariableStack = EvalEngine.localStack(fSymbolName);
  4. localVariableStack.set(localVariableStack.size() - 1, value);
  5. }

代码示例来源:origin: com.yahoo.pulsar/pulsar-broker

  1. private void checkSeparator() {
  2. if (separators.isEmpty()) {
  3. return;
  4. } else if (separators.peek() == Boolean.TRUE) {
  5. write(",");
  6. } else {
  7. separators.set(separators.size() - 1, Boolean.TRUE);
  8. }
  9. }
  10. }

代码示例来源:origin: org.xwiki.commons/xwiki-commons-context

  1. @Override
  2. public void setContext(ExecutionContext context)
  3. {
  4. Stack<ExecutionContext> stack = this.context.get();
  5. if (stack == null) {
  6. stack = new Stack<ExecutionContext>();
  7. this.context.set(stack);
  8. stack.push(context);
  9. } else if (stack.isEmpty()) {
  10. stack.push(context);
  11. } else {
  12. if (context != null) {
  13. context.inheritFrom(stack.peek());
  14. }
  15. stack.set(stack.size() - 1, context);
  16. }
  17. }

代码示例来源:origin: org.xwiki.platform/xwiki-core-rendering-parser-wikimodel

  1. public void beginHeader(int level, WikiParameters params)
  2. {
  3. int sectionLevel = this.currentSectionLevel.peek();
  4. // Close sections
  5. for (; sectionLevel >= level; --sectionLevel) {
  6. this.stack.push(new SectionBlock(generateListFromStack()));
  7. }
  8. // Open sections
  9. for (; sectionLevel < level; ++sectionLevel) {
  10. this.stack.push(this.marker);
  11. }
  12. this.currentSectionLevel.set(this.currentSectionLevel.size() - 1, sectionLevel);
  13. // Push header
  14. this.stack.push(this.marker);
  15. }

代码示例来源:origin: firebase/firebase-admin-java

  1. private void startChild(ChildKey key) {
  2. ensureRange();
  3. if (needsComma) {
  4. optHashValueBuilder.append(",");
  5. }
  6. appendKey(optHashValueBuilder, key);
  7. optHashValueBuilder.append(":(");
  8. if (currentPathDepth == currentPath.size()) {
  9. currentPath.add(key);
  10. } else {
  11. currentPath.set(currentPathDepth, key);
  12. }
  13. currentPathDepth++;
  14. needsComma = false;
  15. }

代码示例来源:origin: org.xwiki.commons/xwiki-commons-extension-handler-jar

  1. private UninstalledExtensionCollection getCurrentJobUninstalledExtensions(boolean create)
  2. {
  3. ExecutionContext context = this.execution.getContext();
  4. if (context != null) {
  5. Stack<UninstalledExtensionCollection> extensions = getUninstalledExtensionCollectionStack(false);
  6. if (extensions != null) {
  7. UninstalledExtensionCollection collection = extensions.peek();
  8. if (collection == null && create) {
  9. collection = new UninstalledExtensionCollection();
  10. extensions.set(extensions.size() - 1, collection);
  11. }
  12. return collection;
  13. }
  14. }
  15. return null;
  16. }

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

  1. /**
  2. * JPOX wrapper addition that allows turning off of the dependent-field checks
  3. * when doing the position setting. This means that we can prevent the deletion of
  4. * the object that was previously in that position. This particular feature is used
  5. * when attaching a list field and where some elements have changed positions.
  6. * @param index The position
  7. * @param element The new element
  8. * @return The element previously at that position
  9. */
  10. public Object set(int index, Object element, boolean allowDependentField)
  11. {
  12. // Reject inappropriate elements
  13. if (element == null && !allowNulls)
  14. {
  15. throw new NullsNotAllowedException(ownerSM, fieldName);
  16. }
  17. makeDirty();
  18. if (useCache)
  19. {
  20. loadFromStore();
  21. }
  22. if (backingStore != null)
  23. {
  24. backingStore.set(ownerSM, index, element, allowDependentField);
  25. }
  26. return delegate.set(index, element);
  27. }

相关文章