Java Code Examples for tech.tablesaw.columns.Column#size()

The following examples show how to use tech.tablesaw.columns.Column#size() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: XlsxReaderTest.java    From tablesaw with Apache License 2.0 6 votes vote down vote up
@SafeVarargs
private final <T> void assertColumnValues(Column<T> column, T... ts) {
  for (int i = 0; i < column.size(); i++) {
    if (ts[i] == null) {
      assertTrue(
          column.isMissing(i),
          "Should be missing value in row "
              + i
              + " of column "
              + column.name()
              + ", but it was "
              + column.get(i));
    } else {
      assertEquals(
          ts[i], column.get(i), "Wrong value in row " + i + " of column " + column.name());
    }
  }
}
 
Example 2
Source File: XlsxReaderTest.java    From tablesaw with Apache License 2.0 6 votes vote down vote up
@SafeVarargs
private final <T> void assertColumnValues(Column<T> column, T... ts) {
  for (int i = 0; i < column.size(); i++) {
    if (ts[i] == null) {
      assertTrue(
          column.isMissing(i),
          "Should be missing value in row "
              + i
              + " of column "
              + column.name()
              + ", but it was "
              + column.get(i));
    } else {
      assertEquals(
          ts[i], column.get(i), "Wrong value in row " + i + " of column " + column.name());
    }
  }
}
 
Example 3
Source File: TraceBuilder.java    From tablesaw with Apache License 2.0 5 votes vote down vote up
protected static String[] columnToStringArray(Column<?> column) {
  String[] x = new String[column.size()];
  for (int i = 0; i < column.size(); i++) {
    x[i] = column.getString(i);
  }
  return x;
}
 
Example 4
Source File: TraceBuilder.java    From tablesaw with Apache License 2.0 5 votes vote down vote up
protected static String[] columnToStringArray(Column<?> column) {
  String[] x = new String[column.size()];
  for (int i = 0; i < column.size(); i++) {
    x[i] = column.getString(i);
  }
  return x;
}
 
Example 5
Source File: AggregateFunctions.java    From tablesaw with Apache License 2.0 4 votes vote down vote up
@Override
public Integer summarize(Column<?> column) {
  return column.size() - column.countMissing();
}
 
Example 6
Source File: AggregateFunctions.java    From tablesaw with Apache License 2.0 4 votes vote down vote up
@Override
public Integer summarize(Column<?> column) {
  return column.size();
}
 
Example 7
Source File: DataFramePrinter.java    From tablesaw with Apache License 2.0 4 votes vote down vote up
private String getDataToken(Column<?> col, int i) {
  return col.size() > i ? col.getString(i) : TOO_SHORT_COLUMN_MARKER;
}
 
Example 8
Source File: TableTest.java    From tablesaw with Apache License 2.0 4 votes vote down vote up
private int appendColumn(Table table, Column<?> column) {
  Table tableToAppend = Table.create("populated", column);
  table.append(tableToAppend);
  return column.size();
}
 
Example 9
Source File: AggregateFunctions.java    From tablesaw with Apache License 2.0 4 votes vote down vote up
@Override
public Integer summarize(Column<?> column) {
  return column.size() - column.countMissing();
}
 
Example 10
Source File: AggregateFunctions.java    From tablesaw with Apache License 2.0 4 votes vote down vote up
@Override
public Integer summarize(Column<?> column) {
  return column.size();
}
 
Example 11
Source File: DataFramePrinter.java    From tablesaw with Apache License 2.0 4 votes vote down vote up
private String getDataToken(Column<?> col, int i) {
  return col.size() > i ? col.getString(i) : TOO_SHORT_COLUMN_MARKER;
}
 
Example 12
Source File: TableTest.java    From tablesaw with Apache License 2.0 4 votes vote down vote up
private int appendColumn(Table table, Column<?> column) {
  Table tableToAppend = Table.create("populated", column);
  table.append(tableToAppend);
  return column.size();
}