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

x33g5p2x  于2022-01-15 转载在 其他  
字(6.9k)|赞(0)|评价(0)|浏览(209)

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

ArrayList.toString介绍

暂无

代码示例

代码示例来源:origin: ReactiveX/RxJava

@Override
  public String toString() {
    return list.toString();
  }
}

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

@Override
  public String toString() {
    return list.toString();
  }
}

代码示例来源:origin: pagehelper/Mybatis-PageHelper

@Override
public String toString() {
  return "Page{" +
      "count=" + count +
      ", pageNum=" + pageNum +
      ", pageSize=" + pageSize +
      ", startRow=" + startRow +
      ", endRow=" + endRow +
      ", total=" + total +
      ", pages=" + pages +
      ", reasonable=" + reasonable +
      ", pageSizeZero=" + pageSizeZero +
      '}' + super.toString();
}

代码示例来源:origin: hankcs/HanLP

@Override
  public String toString()
  {
    ArrayList<Integer> head = new ArrayList<Integer>(20);
    for (int i = 0; i < Math.min(size, 20); ++i)
    {
      head.add(data[i]);
    }
    return head.toString();
  }
}

代码示例来源:origin: stanfordnlp/CoreNLP

/**
 * Prints the array entries in sorted comparator order.
 * @return The array entries in sorted comparator order.
 */
@Override
public String toString() {
 ArrayList<E> result = new ArrayList<>();
 for(E key : objectToEntry.keySet())
  result.add(key);
 Collections.sort(result,cmp);
 return result.toString();
}

代码示例来源:origin: hibernate/hibernate-orm

@Override
public String toString() {
  return getClass().getName() + '(' + properties.toString() + ')';
}

代码示例来源:origin: commons-collections/commons-collections

/**
 * Return a String representation of this object.
 */
public String toString() {
  StringBuffer sb = new StringBuffer("FastArrayList[");
  sb.append(list.toString());
  sb.append("]");
  return (sb.toString());
}

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

/**
 * Return a String representation of this object.
 */
public String toString() {
  StringBuffer sb = new StringBuffer("FastArrayList[");
  sb.append(list.toString());
  sb.append("]");
  return (sb.toString());
}

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

private String getNewInstanceArgumentString(Object [] args) {
 if (args == null) {
  return "arguments: NULL";
 }
 ArrayList<String> argClasses = new ArrayList<>();
 for (Object obj : args) {
  argClasses.add(obj.getClass().getSimpleName());
 }
 return "arguments: " + Arrays.toString(args) + ", argument classes: " + argClasses.toString();
}

代码示例来源:origin: knowm/XChange

@Override
public String toString() {
 StringBuilder sb = new StringBuilder();
 sb.append("class ReturnOpenOrdersResponse {\n");
 sb.append("    ").append(toIndentedString(super.toString())).append("\n");
 sb.append("}");
 return sb.toString();
}

代码示例来源:origin: knowm/XChange

@Override
public String toString() {
 StringBuilder sb = new StringBuilder();
 sb.append("class TradeResponse {\n");
 sb.append("    ").append(toIndentedString(super.toString())).append("\n");
 sb.append("}");
 return sb.toString();
}

代码示例来源:origin: knowm/XChange

@Override
public String toString() {
 StringBuilder sb = new StringBuilder();
 sb.append("class ReturnOrderTradesResponse {\n");
 sb.append("    ").append(toIndentedString(super.toString())).append("\n");
 sb.append("}");
 return sb.toString();
}

代码示例来源:origin: knowm/XChange

@Override
public String toString() {
 StringBuilder sb = new StringBuilder();
 sb.append("class WithdrawalsResponse {\n");
 sb.append("    ").append(toIndentedString(super.toString())).append("\n");
 sb.append("}");
 return sb.toString();
}

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

@Explain(vectorization = Vectorization.EXPRESSION, displayName = "evaluatorClasses", explainLevels = { Level.DEFAULT, Level.EXTENDED })
public String getEvaluatorClasses() {
 VectorPTFEvaluatorBase[] evaluators = VectorPTFDesc.getEvaluators(vectorPTFDesc, vectorPTFInfo);
 ArrayList<String> result = new ArrayList<String>(evaluators.length);
 for (VectorPTFEvaluatorBase evaluator : evaluators) {
  result.add(evaluator.getClass().getSimpleName());
 }
 return result.toString();
}

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

/**
 * {@inheritDoc}
 */
@Override public String toString() {
  return "[Long=" + Long.toString(innerLongCol) +
    ", String='" + innerStrCol + "'" +
    ", ArrayList=" + arrListCol.toString() +
    "]";
}

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

@Explain(vectorization = Vectorization.DETAIL, displayName = "streamingColumns", explainLevels = { Level.DEFAULT, Level.EXTENDED })
 public String getStreamingColumns() {
  VectorPTFEvaluatorBase[] evaluators = VectorPTFDesc.getEvaluators(vectorPTFDesc, vectorPTFInfo);
  ArrayList<Integer> result = new ArrayList<Integer>();
  for (VectorPTFEvaluatorBase evaluator : evaluators) {
   if (evaluator.streamsResult()) {
    result.add(evaluator.getOutputColumnNum());
   }
  }
  return result.toString();
 }
}

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

@Override
protected void verifyResultsDataPersistenceUponMissedNotify(ListSink sink) {
  ArrayList<Integer> list = new ArrayList<>();
  for (int x = 1; x <= 60; x++) {
    list.add(x);
  }
  for (Integer i : sink.values) {
    list.remove(i);
  }
  Assert.assertTrue("The following ID's where not found in the result list: " + list.toString(), list.isEmpty());
  Assert.assertTrue("The sink emitted to many values: " + (sink.values.size() - 60), sink.values.size() == 60);
}

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

@Override
protected void verifyResultsIdealCircumstances(ListSink sink) {
  ArrayList<Integer> list = new ArrayList<>();
  for (int x = 1; x <= 60; x++) {
    list.add(x);
  }
  for (Integer i : sink.values) {
    list.remove(i);
  }
  Assert.assertTrue("The following ID's where not found in the result list: " + list.toString(), list.isEmpty());
  Assert.assertTrue("The sink emitted to many values: " + (sink.values.size() - 60), sink.values.size() == 60);
}

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

@Override
protected void verifyResultsDataDiscardingUponRestore(ListSink sink) {
  ArrayList<Integer> list = new ArrayList<>();
  for (int x = 1; x <= 20; x++) {
    list.add(x);
  }
  for (int x = 41; x <= 60; x++) {
    list.add(x);
  }
  for (Integer i : sink.values) {
    list.remove(i);
  }
  Assert.assertTrue("The following ID's where not found in the result list: " + list.toString(), list.isEmpty());
  Assert.assertTrue("The sink emitted to many values: " + (sink.values.size() - 40), sink.values.size() == 40);
}

代码示例来源:origin: stanfordnlp/CoreNLP

public List<HasWord> segment(String s) {
 buildSegmentationLattice(s);
 ArrayList<Word> sent = maxMatchSegmentation();
 printlnErr("raw output: "+ SentenceUtils.listToString(sent));
 ArrayList<Word> postProcessedSent = postProcessSentence(sent);
 printlnErr("processed output: "+ SentenceUtils.listToString(postProcessedSent));
 ChineseStringUtils.CTPPostProcessor postProcessor = new ChineseStringUtils.CTPPostProcessor();
 String postSentString = postProcessor.postProcessingAnswer(postProcessedSent.toString(), false);
 printlnErr("Sighan2005 output: "+postSentString);
 String[] postSentArray = postSentString.split("\\s+");
 ArrayList<Word> postSent = new ArrayList<>();
 for(String w : postSentArray) {
  postSent.add(new Word(w));
 }
 return new ArrayList<>(postSent);
}

相关文章