Class FixedColumnLengthTableMaker


  • public class FixedColumnLengthTableMaker
    extends java.lang.Object
    Light-weight utility for creating rows where each column has a fixed length in a command-line setting.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      char bottomBorder
      Character to duplicate to make the bottom border.
      java.lang.String decimalFormatter
      Format String to apply to decimal entries.
      int elementLength
      Length of table elements.
      java.lang.String leftBorder
      The border to use to make the left side of the table.
      int leftPadding
      The amount of spacing to pad left of an element with.
      java.util.function.Function<java.lang.Integer,​java.lang.Integer> lengthFunction
      If not null, lengthFunction should give the length for the given column index.
      java.lang.String rightBorder
      The border to use to make the right side of the table.
      int rightPadding
      The amount of spacing to pad right of an element with.
      java.lang.String separator
      The String to separate elements with.
      char topBorder
      Character to duplicate to make the top border.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String make​(java.lang.Object[][] rows)
      Make a table using the specified settings.
      • Methods inherited from class java.lang.Object

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

      • bottomBorder

        public char bottomBorder
        Character to duplicate to make the bottom border.
      • decimalFormatter

        public java.lang.String decimalFormatter
        Format String to apply to decimal entries. If set to null, no special formatting is applied.
      • elementLength

        public int elementLength
        Length of table elements. Elements whose String representations exceed this length are trimmed down to this length.
      • leftBorder

        public java.lang.String leftBorder
        The border to use to make the left side of the table.
      • leftPadding

        public int leftPadding
        The amount of spacing to pad left of an element with.
      • rightBorder

        public java.lang.String rightBorder
        The border to use to make the right side of the table.
      • rightPadding

        public int rightPadding
        The amount of spacing to pad right of an element with.
      • separator

        public java.lang.String separator
        The String to separate elements with.
      • topBorder

        public char topBorder
        Character to duplicate to make the top border.
      • lengthFunction

        public java.util.function.Function<java.lang.Integer,​java.lang.Integer> lengthFunction
        If not null, lengthFunction should give the length for the given column index.
    • Constructor Detail

      • FixedColumnLengthTableMaker

        public FixedColumnLengthTableMaker()
    • Method Detail

      • make

        public java.lang.String make​(java.lang.Object[][] rows)
        Make a table using the specified settings.
        Parameters:
        rows - Rows to construct the table from.
        Returns:
        A String version of the table.