Package jme3utilities.debug
Class Dumper
java.lang.Object
jme3utilities.debug.Dumper
- All Implemented Interfaces:
Cloneable
- Direct Known Subclasses:
PhysicsDumper
Dump portions of a Libbulletjme object for debugging.
The level of detail can be configured dynamically.
-
Field Summary
Modifier and TypeFieldDescriptionprotected final PrintStream
stream to use for output: set by constructor -
Constructor Summary
ConstructorDescriptionDumper()
Instantiate a dumper that will use System.out for output.Dumper
(PrintStream printStream) Instantiate a dumper that will use the specified output stream. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addDescription
(String description) If the specified description is non-empty, print it to the stream, prefixed by a blank.protected void
Print a newline, followed by the specified indentation.clone()
Create a deep copy of this Dumper.Access the Describer used by this dumper.Return the indent increment.setDescriber
(Describer newDescriber) Replace the current Describer with the specified one.setIndentIncrement
(String newValue) Configure the indent increment.
-
Field Details
-
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
Instantiate a dumper that will use the specified output stream.- Parameters:
printStream
- the output stream (not null, alias created)
-
-
Method Details
-
getDescriber
Access the Describer used by this dumper.- Returns:
- the pre-existing instance (not null)
-
indentIncrement
Return the indent increment.- Returns:
- (not null, may be empty)
-
setDescriber
Replace the current Describer with the specified one.- Parameters:
newDescriber
- the desired Describer (not null, alias created)- Returns:
- this instance for chaining
-
setIndentIncrement
Configure the indent increment.- Parameters:
newValue
- (not null, default=" ")- Returns:
- this instance for chaining
-
addDescription
If the specified description is non-empty, print it to the stream, prefixed by a blank.- Parameters:
description
- (not null)
-
addLine
Print a newline, followed by the specified indentation.- Parameters:
indent
- (not null)
-
clone
Create a deep copy of this Dumper.- Overrides:
clone
in classObject
- Returns:
- a new instance, equivalent to this one, with its own Describer
- Throws:
CloneNotSupportedException
- if the superclass isn't cloneable
-