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

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

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

Stack.set介绍

暂无

代码示例

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

stack.set(stack.size() - 1, stack.peek() - 2 + 1);
  break;
case FUNCTION:
  stack.set(stack.size() - 1, stack.peek() + 1);
  break;
case OPEN_PAREN:
  break;
default:
  stack.set(stack.size() - 1, stack.peek() + 1);

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

stack.set(mylevel, null);

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

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

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

stack.set(mylevel, null);

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

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

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

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

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

private boolean isStart() {
  boolean b = sepstack.peek();
  if (b) {
    sepstack.set(sepstack.size() - 1, false);
  }
  return b;
}

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

/**
  Swap in the value as the new top of the stack and return the old
  value.
*/
public NameSpace swap( NameSpace newTop ) {
  int last = stack.size() - 1;
  NameSpace oldTop = stack.get(last);
  stack.set( last, newTop );
  return oldTop;
}

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

private void indent() throws XMLStreamException {
  delegate.writeCharacters(NEW_LINE, 0, 1);
  for (int i = 0; i < indent; i++) {
    delegate.writeCharacters(SPACE, 0, 1);
  }
  indent += INDENT_SIZE;
  if (!stack.empty()) {
    stack.set(stack.size() - 1, Boolean.TRUE);
  }
  stack.push(Boolean.FALSE);
}

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

public void setScannerContext(WikiScannerContext context) {
  if (fScannerContext.isEmpty()) {
    pushScannerContext(context);
  } else {
    fScannerContext.set(fScannerContext.size() - 1, context);
  }
}

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

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

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

private void checkSeparator() {
    if (separators.isEmpty()) {
      return;
    } else if (separators.peek() == Boolean.TRUE) {
      write(",");
    } else {
      separators.set(separators.size() - 1, Boolean.TRUE);
    }
  }
}

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

public static void addGracePeriod(long time) {
  if (!logger.isDebugEnabled())
    return;
  Stack<Long> stack = gracePeriod.get();
  if (stack == null)
    return;
  for (int i = 0; i < stack.size(); i++) {
    long existing = stack.get(i);
    stack.set(i, existing + time);
  }
}

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

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

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

private void checkSeparator() {
    if (separators.isEmpty()) {
      return;
    } else if (separators.peek() == Boolean.TRUE) {
      write(",");
    } else {
      separators.set(separators.size() - 1, Boolean.TRUE);
    }
  }
}

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

@Override
public void setContext(ExecutionContext context)
{
  Stack<ExecutionContext> stack = this.context.get();
  if (stack == null) {
    stack = new Stack<ExecutionContext>();
    this.context.set(stack);
    stack.push(context);
  } else if (stack.isEmpty()) {
    stack.push(context);
  } else {
    if (context != null) {
      context.inheritFrom(stack.peek());
    }
    stack.set(stack.size() - 1, context);
  }
}

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

public void beginHeader(int level, WikiParameters params)
{
  int sectionLevel = this.currentSectionLevel.peek();
  // Close sections
  for (; sectionLevel >= level; --sectionLevel) {
    this.stack.push(new SectionBlock(generateListFromStack()));
  }
  // Open sections
  for (; sectionLevel < level; ++sectionLevel) {
    this.stack.push(this.marker);
  }
  this.currentSectionLevel.set(this.currentSectionLevel.size() - 1, sectionLevel);
  // Push header
  this.stack.push(this.marker);
}

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

private void startChild(ChildKey key) {
 ensureRange();
 if (needsComma) {
  optHashValueBuilder.append(",");
 }
 appendKey(optHashValueBuilder, key);
 optHashValueBuilder.append(":(");
 if (currentPathDepth == currentPath.size()) {
  currentPath.add(key);
 } else {
  currentPath.set(currentPathDepth, key);
 }
 currentPathDepth++;
 needsComma = false;
}

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

private UninstalledExtensionCollection getCurrentJobUninstalledExtensions(boolean create)
{
  ExecutionContext context = this.execution.getContext();
  if (context != null) {
    Stack<UninstalledExtensionCollection> extensions = getUninstalledExtensionCollectionStack(false);
    if (extensions != null) {
      UninstalledExtensionCollection collection = extensions.peek();
      if (collection == null && create) {
        collection = new UninstalledExtensionCollection();
        extensions.set(extensions.size() - 1, collection);
      }
      return collection;
    }
  }
  return null;
}

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

/**
 * JPOX wrapper addition that allows turning off of the dependent-field checks
 * when doing the position setting. This means that we can prevent the deletion of
 * the object that was previously in that position. This particular feature is used
 * when attaching a list field and where some elements have changed positions.
 * @param index The position
 * @param element The new element
 * @return The element previously at that position
 */
public Object set(int index, Object element, boolean allowDependentField)
{
  // Reject inappropriate elements
  if (element == null && !allowNulls)
  {
    throw new NullsNotAllowedException(ownerSM, fieldName);
  }
  makeDirty();
  if (useCache)
  {
    loadFromStore();
  }
  if (backingStore != null)
  {
    backingStore.set(ownerSM, index, element, allowDependentField);
  }
  return delegate.set(index, element);
}

相关文章