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

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

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

Stack.toString介绍

暂无

代码示例

代码示例来源:origin: magefree/mage

@Override
public void restoreState(int bookmark, String context) {
  if (!simulation && !this.hasEnded()) { // if player left or game is over no undo is possible - this could lead to wrong winner
    if (bookmark != 0) {
      if (!savedStates.contains(bookmark - 1)) {
        if (!savedStates.isEmpty()) { // empty if rollback to a turn was requested before, otherwise unclear why
          logger.error("It was not possible to do the requested undo operation (bookmark " + (bookmark - 1) + " does not exist) context: " + context);
          logger.info("Saved states: " + savedStates.toString());
        }
      } else {
        int stateNum = savedStates.get(bookmark - 1);
        removeBookmark(bookmark);
        GameState restore = gameStates.rollback(stateNum);
        if (restore != null) {
          state.restore(restore);
          playerList.setCurrent(state.getPlayerByOrderId());
        }
      }
    }
  }
}

代码示例来源:origin: org.graphstream/gs-core

/**
 * Returns a String description of the path.
 * 
 * @return A String representation of the path.
 */
@Override
public String toString() {
  return nodePath.toString();
}

代码示例来源:origin: graphstream/gs-core

/**
 * Returns a String description of the path.
 * 
 * @return A String representation of the path.
 */
@Override
public String toString() {
  return nodePath.toString();
}

代码示例来源:origin: onyxbits/Raccoon

@Override
public String toString() {
  return rawModel.toString() + scopes.toString();
}

代码示例来源:origin: com.floreysoft/jmte

@Override
public String toString() {
  return rawModel.toString() + scopes.toString();
}

代码示例来源:origin: com.mockrunner/mockrunner-jdk1.3-j2ee1.3

public String toString()
  {
    return this.getClass().getName() + ": " + data.toString();
  }
}

代码示例来源:origin: com.mockrunner/mockrunner-jdk1.4-j2ee1.3

public String toString()
  {
    return this.getClass().getName() + ": " + data.toString();
  }
}

代码示例来源:origin: org.apache.tuscany.sca/tuscany-base-runtime

public Problem createProblem(String sourceClassName,
               String bundleName,
               Severity severity,
               Object problemObject,
               String messageId,
               Object... messageParams) {
  return new ProblemImpl(sourceClassName, bundleName, severity, contextStack.toString(), problemObject, messageId, messageParams);
}

代码示例来源:origin: org.apache.tuscany.sca/tuscany-monitor

public Problem createProblem(String sourceClassName,
               String bundleName,
               Severity severity,
               Object problemObject,
               String messageId,
               Object... messageParams) {
  return new ProblemImpl(sourceClassName, bundleName, severity, contextStack.toString(), problemObject, messageId, messageParams);
}

代码示例来源:origin: org.apache.tuscany.sca/tuscany-base-runtime

public Problem createProblem(String sourceClassName,
               String bundleName,
               Severity severity,
               Object problemObject,
               String messageId,
               Throwable cause,
               Object... messageParams) {
  return new ProblemImpl(sourceClassName, bundleName, severity, contextStack.toString(), problemObject, messageId, cause, messageParams);
}

代码示例来源:origin: org.apache.tuscany.sca/tuscany-monitor

public Problem createProblem(String sourceClassName,
               String bundleName,
               Severity severity,
               Object problemObject,
               String messageId,
               Throwable cause,
               Object... messageParams) {
  return new ProblemImpl(sourceClassName, bundleName, severity, contextStack.toString(), problemObject, messageId, cause, messageParams);
}

代码示例来源:origin: kloiasoft/eventapis

public String generateContext(@Nullable String parentOpId, boolean preGenerated) {
  if (operationContext.get().size() > 1)
    throw new IllegalStateException("There is Already Parent Context: " + operationContext.get().toString());
  String opId = generateOpId();
  switchContext(opId, parentOpId, preGenerated);
  return opId;
}

代码示例来源:origin: org.apache.clerezza/platform.documentation.viewer

private Set<IRI> getAfterDocItems(Stack<DocumentationItem> stack) {
  if (!transitiveAfterDocItemsAdded) {
    Set<IRI> afterDocItemsClone = new HashSet<>(afterDocItems);
    Iterator<IRI> afterDocUrisIter = afterDocItemsClone.iterator();
    while (afterDocUrisIter.hasNext()) {
      IRI uriRef = afterDocUrisIter.next();
      DocumentationItem docItem = uri2docItemObj.get(uriRef);
      if (stack.contains(docItem)) {
        throw new RuntimeException("Documentation: cycle detected!\n"
          + stack.toString());
      }
      stack.add(docItem);
      afterDocItems.addAll(docItem.getAfterDocItems(stack));
      
    }
    transitiveAfterDocItemsAdded = true;
  }             
  return afterDocItems;
}

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

public void test2() throws IOException {
  String test =
      "{2 index 1.000000 cvr exch sub 4 1 roll 1 index 1.000000 cvr exch sub \n" +
          "4 1 roll 0 index 1.000000 cvr exch sub 4 1 roll 1.000000 4 1 \n" +
          "roll 7 -1 roll 1.000000 cvr exch sub 7 1 roll 6 -1 roll 1.000000 \n" +
          "cvr exch sub 6 1 roll 5 -1 roll 1.000000 cvr exch sub 5 1 \n" +
          "roll 4 -1 roll 1.000000 cvr exch sub 4 1 roll pop pop pop }";
  InputStream function_4 = new ByteArrayInputStream(test.getBytes());
  Lexer lex = new Lexer();
  lex.setInputStream(function_4);
  lex.parse(new float[]{0.360779f, 0.094238274f, 0.00392151f});
  System.out.println("result: " + lex.getStack().toString());
}

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

public void test5() throws IOException {
  String test =
      "{2 index 1.000000 cvr exch sub 4 1 roll 1 index 1.000000 cvr exch sub \n" +
          "4 1 roll 0 index 1.000000 cvr exch sub 4 1 roll 1.000000 4 1 \n" +
          "roll 7 -1 roll 1.000000 cvr exch sub 7 1 roll 6 -1 roll 1.000000 \n" +
          "cvr exch sub 6 1 roll 5 -1 roll 1.000000 cvr exch sub 5 1 \n" +
          "roll 4 -1 roll 1.000000 cvr exch sub 4 1 roll pop pop pop }";
  InputStream function_4 = new ByteArrayInputStream(test.getBytes());
  Lexer lex = new Lexer();
  lex.setInputStream(function_4);
  lex.parse(new float[]{0.360779f, 0.094238274f, 0.00392151f});
  System.out.println("result: " + lex.getStack().toString());
}

代码示例来源:origin: org.biopax.validator/biopax-rules

@Override
  protected void visit(Object range, BioPAXElement domain, Model model,
      PropertyEditor editor) {
    assert range instanceof PhysicalEntity; // - because of filter and mul.cardinality
    if (thing.equals(range)) {
      error(thing, "cyclic.inclusion", false, getVisited().toString());
    } else if(range instanceof Complex) {
      traverse((Complex) range, model);
    }
  }
};

代码示例来源:origin: org.biopax.validator/biopax-rules

@Override
  protected void visit(Object range, BioPAXElement domain, Model model,
      PropertyEditor editor) {
    if (thing.equals(range)) {
      error(thing, "cyclic.inclusion", false, getVisited().toString());
    } else {
      traverse((BioPAXElement) range, model);
    }
  }
};

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

public void test1() throws IOException {
  String test =
      "{1.000000 3 1 roll 1.000000 3 1 roll 1.000000 3 1 roll 5 -1 roll \n" +
          "2 index -0.874500 mul 1.000000 add mul 1 index -0.098000 mul 1.000000 add mul 5 \n" +
          "1 roll 4 -1 roll 2 index -0.796100 mul 1.000000 add mul 1 index -0.247100 \n" +
          "mul 1.000000 add mul 4 1 roll 3 -1 roll 2 index -0.647100 mul 1.000000 \n" +
          "add mul 1 index -0.878400 mul 1.000000 add mul 3 1 roll pop pop }";
  ;
  InputStream function_4 = new ByteArrayInputStream(test.getBytes());
  Lexer lex = new Lexer();
  lex.setInputStream(function_4);
  lex.parse(new float[]{1.0f, 1.0f});
  System.out.println("result: " + lex.getStack().toString());
}

代码示例来源:origin: Rsl1122/Plan-PlayerAnalytics

private void testHtmlValidity(String html) {
    Stack<String> stack = new Stack<>();
    String[] split = html.split("<");
    for (String s : split) {
      if (s.startsWith("/")) {
        String expectedElement = stack.pop();
        assertTrue("Element not properly closed: " + expectedElement, s.startsWith("/" + expectedElement));
      } else {
        stack.push(s.split(" ", 2)[0].split(">", 2)[0]);
      }
    }
    stack.pop(); // Pop the empty string since the html string starts with <
    assertTrue("Stack was not empty: " + stack.toString(), stack.empty());
  }
}

代码示例来源:origin: testIT-LivingDoc/livingdoc-core

public String getMethodName() throws IllegalArgumentException, InvocationTargetException, IllegalAccessException,
  SystemUnderDevelopmentException {
  stack.clear();
  Message message = fixture.check(objectGraph);
  message.send();
  String s = stack.toString();
  return s.substring(1, s.length() - 1);
}

相关文章