Class PrintSeparator

  • All Implemented Interfaces:
    Printable

    public final class PrintSeparator
    extends java.lang.Object
    implements Printable
    Utility class used to separate a sequence of print operations.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String next()
      Gets the separator for the next print operation.
      void print​(ClassPrinter out, ClassContext context)
      Prints this instance.
      void reset()
      Resets this instance to start a new sequence of print operations.
      • Methods inherited from class java.lang.Object

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

      • PrintSeparator

        public PrintSeparator()
        Constructs a new PrintSeparator instance using the comma separator.
      • PrintSeparator

        public PrintSeparator​(java.lang.String separator)
        Constructs a new PrintSeparator instance using the given separator.
        Parameters:
        separator - the separator to use.
    • Method Detail

      • reset

        public void reset()
        Resets this instance to start a new sequence of print operations.
      • print

        public void print​(ClassPrinter out,
                          ClassContext context)
                   throws java.io.IOException
        Description copied from interface: Printable
        Prints this instance.
        Specified by:
        print in interface Printable
        Parameters:
        out - the ClassPrinter instance to print to.
        context - the context of this print invocation.
        Throws:
        java.io.IOException - if an I/O error occurs.
      • next

        public java.lang.String next()
        Gets the separator for the next print operation.
        Returns:
        the separator for the next print operation.