Class Block

All Implemented Interfaces:
Formattable, Serializable, Cloneable

public class Block extends Compound
Prints all sub-formats in the same line as long as possible, and starts a new line for every sub-format which would (probably) exceeded the page width. An explicitly set indentation value of an immediate child is inherited to all successors. Indentation is respected at the beginning of all lines except the very first.
See Also:
  • Constructor Details

    • Block

      protected Block(List<Format> f)
      A constructor with some field values explicit, some calculated from the subformats. In contrast to the factory methods, denormalized instances may be constructed.
      Parameters:
      f - the sub-formats contained in this compound
      See Also:
    • Block

      protected Block(Format... f)
      A constructor with some field values explicit, some calculated from the subformats. In contrast to the factory methods, denormalized instances may be constructed.
      Parameters:
      f - the sub-formats contained in this compound
      See Also:
    • Block

      protected Block(int i, int a, boolean m, boolean g, int ind, List<Format> f)
      The constructor which sets all field values explicitly. Consistency of the attributes must be realized by the caller. In contrast to the factory methods, denormalized instances may be constructed.
      Parameters:
      i - the minimal width of the format
      a - the maximal width of the format
      m - whether the format will print to multiple lines anyhow
      g - whether the format does not contain any variable
      ind - the indentation value of this format
      f - the sub-formats contained in this compound
      Throws:
      IllegalArgumentException - if ident value not valid, see Format.checkValidIndent(int)
  • Method Details

    • constructor

      public CompoundConstructor constructor()
      Description copied from class: Compound
      Returns the reification of the constructor of this instance. That enum type has "apply()" methods which generate a corresponding instance.
      Specified by:
      constructor in class Compound
      Returns:
      the reification of the constructor of this instance.
    • 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