Class NodeFormatter<V>

  • All Implemented Interfaces:
    Formatter<Node<V>>

    public class NodeFormatter<V>
    extends java.lang.Object
    implements Formatter<Node<V>>
    A simple Formatter that provides String representation for parse tree nodes.
    • Constructor Summary

      Constructors 
      Constructor Description
      NodeFormatter​(InputBuffer inputBuffer)
      Creates a new NodeFormatter.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String format​(Node<V> node)
      Create a string representation for the given object.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • NodeFormatter

        public NodeFormatter​(InputBuffer inputBuffer)
        Creates a new NodeFormatter.
        Parameters:
        inputBuffer - the input buffer underlying the parse tree whose nodes are to be formatted.
    • Method Detail

      • format

        public java.lang.String format​(Node<V> node)
        Description copied from interface: Formatter
        Create a string representation for the given object.
        Specified by:
        format in interface Formatter<V>
        Parameters:
        node - the object to format
        Returns:
        a string describing the object