Class Format.Comment

All Implemented Interfaces:
Formattable, Serializable, Cloneable
Enclosing class:
Format

public static class Format.Comment extends Format.Compound
Arranges all sub-formats with leading asterisks, like a javadoc comment. Arranges all sub-formats in a text block which is smaller than usual, and prepends the comment-lead in prefix after each linefeed printed. This format is special because the line prefices must be inserted "physically" into the lower level "block" or "beneath" layout. always at the start of a line. Therefore they are handled by the Format.FormatPrinter directly. This has only one field for this purpose, thus Comments can NOT BE NESTED. This is checked not before trying to print.
See Also:
  • Field Details

  • Constructor Details

    • Comment

      protected Comment(@Opt @Opt String prefix, String linePrefix, @Opt @Opt String suffix, List<Format> f)
      Constructor used by the factory methods.
    • Comment

      protected Comment(int i, int a, boolean m, boolean g, int ind, String prefix, String linePrefix, String suffix, List<Format> f)
      Constructor used only internally by the cloning methods.
  • Method Details

    • constructor

      public CompoundConstructor constructor()
      Unsupported Operation. Comment is a Compound, but it is special as it is not freely compositinal. It thus has no corresponding CompoundConstructor.
      Specified by:
      constructor in class Format.Compound
    • mutate

      public Format.Comment mutate(Consumer<List<Format>> mapSubs)
      Description copied from class: Format.Compound
      Creates a new instance of the same class as this, with sub-formats altered by the given consumer function.
      Specified by:
      mutate in class Format.Compound
    • doprint

      protected void doprint(Format.FormatPrinter v)
      Description copied from class: Format
      Over-ridden by all sub-classes of Format, for performing the adquate print operations. To be printed is the raison d'ĂȘtre of Format objects. These methods do not use the Visitor/Matcher framework, but direct method invocation and basic method dispatch for descending to child nodes.
      Specified by:
      doprint in class Format