Class Dumper

java.lang.Object
jme3utilities.debug.Dumper
All Implemented Interfaces:
Cloneable
Direct Known Subclasses:
PhysicsDumper

public class Dumper extends Object implements Cloneable
Dump portions of a Libbulletjme object for debugging.

The level of detail can be configured dynamically.

  • Field Details

    • stream

      protected final PrintStream stream
      stream to use for output: set by constructor
  • Constructor Details

    • Dumper

      public Dumper()
      Instantiate a dumper that will use System.out for output.
    • Dumper

      public Dumper(PrintStream printStream)
      Instantiate a dumper that will use the specified output stream.
      Parameters:
      printStream - the output stream (not null, alias created)
  • Method Details

    • getDescriber

      public Describer getDescriber()
      Access the Describer used by this dumper.
      Returns:
      the pre-existing instance (not null)
    • indentIncrement

      public String indentIncrement()
      Return the indent increment.
      Returns:
      (not null, may be empty)
    • setDescriber

      public Dumper setDescriber(Describer newDescriber)
      Replace the current Describer with the specified one.
      Parameters:
      newDescriber - the desired Describer (not null, alias created)
      Returns:
      this instance for chaining
    • setIndentIncrement

      public Dumper setIndentIncrement(String newValue)
      Configure the indent increment.
      Parameters:
      newValue - (not null, default=" ")
      Returns:
      this instance for chaining
    • addDescription

      protected void addDescription(String description)
      If the specified description is non-empty, print it to the stream, prefixed by a blank.
      Parameters:
      description - (not null)
    • addLine

      protected void addLine(String indent)
      Print a newline, followed by the specified indentation.
      Parameters:
      indent - (not null)
    • clone

      public Dumper clone() throws CloneNotSupportedException
      Create a deep copy of this Dumper.
      Overrides:
      clone in class Object
      Returns:
      a new instance, equivalent to this one, with its own Describer
      Throws:
      CloneNotSupportedException - if the superclass isn't cloneable