Class Columns

java.lang.Object
com.complexible.common.dataexporter.Columns

public class Columns extends Object
Utility class to create different kinds of columns
Author:
Evren Sirin
  • Constructor Details

    • Columns

      public Columns()
  • Method Details

    • string

      public static FormattedColumn string(String name)
      Returns a column displaying toString values with proper word wrapping. Column is aligned top left.
      Parameters:
      name - name of the column
      Returns:
      string column
    • string

      public static FormattedColumn string(String name, com.brsanthu.dataexporter.model.AlignType align)
      Returns a column displaying toString values with proper word wrapping.
      Parameters:
      name - name of the column
      Returns:
      string column
    • integer

      public static FormattedColumn integer(String name)
      Returns a column for displaying integers with "%,d" formatting. Column is aligned top right.
      Parameters:
      name - name of the column
      Returns:
      integer column
    • decimal

      public static FormattedColumn decimal(String name)
      Returns a column for displaying decimals and floating point numbers with "%,1.1f" formatting. Column is aligned top right.
      Parameters:
      name - name of the column
      Returns:
      decimal column
    • decimal

      public static FormattedColumn decimal(String name, int fractionDigits)
      Returns a column for displaying decimals and floating point numbers with given fraction digits. Column is aligned top right.
      Parameters:
      name - name of the column
      fractionDigits - number of fraction digits to show
      Returns:
      decimal column
    • format

      public static FormattedColumn format(String name, String format)
      Returns a column for displaying cells with arbitrary formatting. Column is aligned top right.
      Parameters:
      name - name of the column
      format - format string
      Returns:
      formatted column
    • merge

      public static MergedColumn merge(String title, com.brsanthu.dataexporter.model.Column... columns)
      Returns a merged column that will span the individual columns.
      Parameters:
      title - title of the merged column
      columns - columns that will be spanned
      Returns:
      merged column
    • ensureWidth

      public static void ensureWidth(com.brsanthu.dataexporter.model.Column column, int width)
      Ensures the given column is at least as wide as the given width.
      Parameters:
      column - the column whose width is being adjusted
      width - the minimum width