com.healthmarketscience.common.util
Class AppendeeObject

java.lang.Object
  extended by com.healthmarketscience.common.util.AppendeeObject
All Implemented Interfaces:
Appendee

public class AppendeeObject
extends Object
implements Appendee

Simple subclass for objects wishing to use the AppendableExt/Appendee interface in new class hierarchies. The toString() method is overridden to call the appendTo(com.healthmarketscience.common.util.AppendableExt) method, so a subclass need only provide a new implementation for the appendTo() method. The default appendTo() implementation appends the result of calling Object.toString(). Also adds a toString(int) method for specifying the initial size of the underlying StringBuilder.

Author:
James Ahlborn

Constructor Summary
AppendeeObject()
           
 
Method Summary
 void appendTo(AppendableExt a)
          Appends this object to the given AppendableExt.
 String toString()
           
 String toString(int size)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AppendeeObject

public AppendeeObject()
Method Detail

appendTo

public void appendTo(AppendableExt a)
              throws IOException
Description copied from interface: Appendee
Appends this object to the given AppendableExt. Called by an AppendableExt when a request is made to append an instance of Appendee.

Specified by:
appendTo in interface Appendee
Parameters:
a - the AppendableExt to which this class should append itself
Throws:
IOException - if the append fails

toString

public String toString(int size)

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2006-2016 Health Market Science. All Rights Reserved.