All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.lwhite1.tablesaw.reducing.CategoryReduceUtils Maven / Gradle / Ivy

There is a newer version: 0.7.7.3
Show newest version
package com.github.lwhite1.tablesaw.reducing;

import com.github.lwhite1.tablesaw.columns.Column;

/**
 *
 */
public interface CategoryReduceUtils extends Column, Iterable {

  int size();

  default String appendAll(String lineBreak) {
    StringBuilder builder = new StringBuilder();
    int count = 0;
    for (String next : this) {
      builder.append(next);
      if (count < size() - 1) {
        builder.append(lineBreak);
        count++;
      } else {
        break;
      }
    }

    return builder.toString();
  }

  default String appendAll() {
    return appendAll(" ");
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy