Class Columns


  • public class Columns
    extends java.lang.Object
    Utility class to create different kinds of columns
    Author:
    Evren Sirin
    • Constructor Summary

      Constructors 
      Constructor Description
      Columns()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static FormattedColumn decimal​(java.lang.String name)
      Returns a column for displaying decimals and floating point numbers with "%,1.1f" formatting.
      static FormattedColumn decimal​(java.lang.String name, int fractionDigits)
      Returns a column for displaying decimals and floating point numbers with given fraction digits.
      static void ensureWidth​(com.brsanthu.dataexporter.model.Column column, int width)
      Ensures the given column is at least as wide as the given width.
      static FormattedColumn format​(java.lang.String name, java.lang.String format)
      Returns a column for displaying cells with arbitrary formatting.
      static FormattedColumn integer​(java.lang.String name)
      Returns a column for displaying integers with "%,d" formatting.
      static MergedColumn merge​(java.lang.String title, com.brsanthu.dataexporter.model.Column... columns)
      Returns a merged column that will span the individual columns.
      static FormattedColumn string​(java.lang.String name)
      Returns a column displaying toString values with proper word wrapping.
      static FormattedColumn string​(java.lang.String name, com.brsanthu.dataexporter.model.AlignType align)
      Returns a column displaying toString values with proper word wrapping.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Columns

        public Columns()
    • Method Detail

      • string

        public static FormattedColumn string​(java.lang.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​(java.lang.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​(java.lang.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​(java.lang.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​(java.lang.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​(java.lang.String name,
                                             java.lang.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​(java.lang.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