Class Markup

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

public class Markup extends Format
Printed literally to the output, but not included in width calculation.
See Also:
  • Field Details

    • content

      protected final String content
      The marked-up contents.
    • isRight

      protected boolean isRight
      Whether this mark-up is the right=closing part of a pair.
  • Constructor Details

    • Markup

      protected Markup(String s, boolean isRight)
      Constructor which sets the contents and unsets the indent value. Factory methods are preferable.
      Parameters:
      s - the text of the markup. (in case of HTML, etc., including all parentheses.)
      isRight - whether the markup is the right = closing part of a pair of markups.
    • Markup

      protected Markup(String s, boolean isRight, int indent)
      Constructor which sets the contents and the indent value. Factory methods are preferable.
      Parameters:
      s - the text of the markup. (in case of HTML, etc., including all parentheses.)
      isRight - whether the markup is the right = closing part of a pair of markups.
      indent - the indetation value
  • Method Details

    • isRight

      public boolean isRight()
      Returns whether this mark-up is the right=closing part of a pair.
      Returns:
      whether this mark-up is the right=closing part of a pair.
    • 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
    • indent

      public Markup 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.
    • 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.
    • getContent

      public String getContent()
      Return the mark-up text.
      Returns:
      the mark-up text.
    • getIsRight

      public boolean getIsRight()
      Return whether this is a right side of a pair.
      Returns:
      whether this is a right side of a pair.