Class Space

java.lang.Object
eu.bandm.tools.format.Format
eu.bandm.tools.format.Space
All Implemented Interfaces:
Formattable, Serializable, Cloneable

public class Space extends Format
Causes horizontal space (of variable width) when in the middle of a line, or one single blank line (independent of its width) when in vertical stack. Does not print horizontally at a start of a linee --- for this there is indent(int).
See Also:
  • Constructor Details

    • Space

      protected Space(int i)
      Create a space format of the given width and unspecified indentation.
      Parameters:
      i - the width of the format. Must be greater than zero.
      Throws:
      IllegalArgumentException - if the given width is smaller than one.
    • Space

      protected Space(int i, int indent)
      Create a space format of the given width and indentation.
      Parameters:
      i - the width of the format. Must be greater than zero.
      indent - the indentation of this format
      Throws:
      IllegalArgumentException - if the given width is smaller than one.
      IllegalArgumentException - if ident value not valid, see Format.checkValidIndent(int)
  • Method Details

    • isSpace

      protected boolean isSpace()
      Description copied from class: Format
      Whether this format is a space.
      Overrides:
      isSpace in class Format
      Returns:
      whether this format is a space.
    • indent

      public Space indent(int i)
      Description copied from class: Format
      Returns a clone of this with the new value of Format.indent.
      Specified by:
      indent in class Format
      Parameters:
      i - the new value for indent.
      Returns:
      an new format with identical values but i, or this, if i is its indent value.
    • doprint

      protected void doprint(FormatPrinter v)
      Description copied from class: Format
      Over-ridden by all sub-classes of Format, for performing the print operations.
      Specified by:
      doprint in class Format
      Parameters:
      v - realizes the dynamic context for printing
    • debugPrefix

      public String debugPrefix(int n)
      Description copied from class: Format
      Deliver the concatenation of the text contents, limited by the given number of characters, approximately. Useful for debugging purpose.
      Specified by:
      debugPrefix in class Format
      Parameters:
      n - the maximal number of characters which can be generated per tree node.
      Returns:
      the concatenated, unformatted text contents.