Class DXPParameterDefinition.FormatInfo

java.lang.Object
com.deltaxml.core.DXPParameterDefinition.FormatInfo
Enclosing class:
DXPParameterDefinition<T extends Comparable<?>>

public static class DXPParameterDefinition.FormatInfo extends Object
A utility class for identifying the space required to display a list of parameter definitions. This class assumes that the width is directly proportional to the number of characters (such as in fixed width fonts).
Author:
anthonys
  • Constructor Summary

    Constructors
    Constructor
    Description
    Construct the fixed-width character format information associated with a list of parameter definitions.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    append(StringBuilder builder, int width, int indent)
    Append the parameter information in tabular form to a StringBuilder.
    int
    Get the width required to display the default value on a single line.
    int
    Get the minimum width required to display the default value whilst splitting lines on whitespace only.
    int
    Get the width required to display the description on a single line.
    int
    Get the width required to display the description whilst splitting lines on whitespace only.
    int
    getMaxWidth(int seperation)
    Get the maximum width required to display all three columns.
    int
    getMinWidth(int seperation)
    Get the minimum width required to display all three columns.
    int
    Get the width required to display the name on a single line.
    int
    Get the minimum width required to display the name whilst splitting lines on whitespace only.
    Overrides the default equals method.
    toString(int width, int indent)
    Returns a formatted String representation of parameters.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • FormatInfo

      public FormatInfo(Iterable<? extends DXPParameterDefinition<?>> pars)
      Construct the fixed-width character format information associated with a list of parameter definitions.
      Parameters:
      pars - The list of parameter definitions.
  • Method Details

    • getNameMinWidth

      public int getNameMinWidth()
      Get the minimum width required to display the name whilst splitting lines on whitespace only.
      Returns:
      The minimum width required to display the name whilst splitting lines on whitespace only.
    • getNameMaxWidth

      public int getNameMaxWidth()
      Get the width required to display the name on a single line.
      Returns:
      The width required to display the name on a single line.
    • getDefaultValueMinWidth

      public int getDefaultValueMinWidth()
      Get the minimum width required to display the default value whilst splitting lines on whitespace only.
      Returns:
      The minimum width required to display the default value whilst splitting lines on whitespace only.
    • getDefaultValueMaxWidth

      public int getDefaultValueMaxWidth()
      Get the width required to display the default value on a single line.
      Returns:
      The width required to display the default value on a single line.
    • getDescriptionMinWidth

      public int getDescriptionMinWidth()
      Get the width required to display the description whilst splitting lines on whitespace only.
      Returns:
      The width required to display the description whilst splitting lines on whitespace only
    • getDescriptionMaxWidth

      public int getDescriptionMaxWidth()
      Get the width required to display the description on a single line.
      Returns:
      The width required to display the description on a single line.
    • getMinWidth

      public int getMinWidth(int seperation)
      Get the minimum width required to display all three columns.
      Parameters:
      seperation - The separation between the columns.
      Returns:
      The minimum width to display all three columns.
    • getMaxWidth

      public int getMaxWidth(int seperation)
      Get the maximum width required to display all three columns.
      Parameters:
      seperation - The separation between the columns.
      Returns:
      The maximum width to display all three columns.
    • append

      public void append(StringBuilder builder, int width, int indent)
      Append the parameter information in tabular form to a StringBuilder.
      Parameters:
      builder - The target StringBuilder.
      width - The maximum width of the table (not including an indent).
      indent - The number of spaces to prefix each output line by.
    • toString

      public String toString(int width, int indent)
      Returns a formatted String representation of parameters.
      Parameters:
      width - the maximum width of the output
      indent - an indent for the output string
      Returns:
      a formatted String representation of parameters
    • toString

      public String toString()
      Overrides the default equals method.

      Implemented as a call to toString(int, int) with width 80 and indent 0

      Overrides:
      toString in class Object
      Returns:
      a formatted String representation of parameters
      See Also: