anthill.util
Class Printable

java.lang.Object
  |
  +--anthill.util.Printable

public class Printable
extends Object

Classes extending Printable automatically inherit a toString() method which prints out their contents. i.e. the value of the fields contained in the object instances. Note that toString() in a Printable object may generate infinite loops if the reference graph obtained starting from the object contains a cycle of Printable objects.

Version:
$Revision: 1.4 $
Author:
Alberto Montresor

Constructor Summary
Printable()
           
 
Method Summary
 String toString()
          toString method to print out the content of an object.
 String toString(String indent)
          Auto-indenting, recursive toString() method to print out the content of an object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Printable

public Printable()
Method Detail

toString

public String toString()
toString method to print out the content of an object.

Overrides:
toString in class Object

toString

public String toString(String indent)
Auto-indenting, recursive toString() method to print out the content of an object.