org.ckkloverdos.string
Interface IPrepareToStringAware
- All Superinterfaces:
- IToStringAware
public interface IPrepareToStringAware
- extends IToStringAware
Gives the ability to alter the state of a IToStringAware
implementation, just before the IToStringAware.toStringAware(ToString)
call is performed. The state is automatically restored by ToString
, so
that you do not have to use ToString.save()
/ToString.restore(ToString)
in your client code.
For example, when we want to ensure that our instance will be printed in a single line, no matter what
the multiline state of the running ToString
instance is, then we should
implement IPrepareToStringAware
like this:
public void prepareToStringAware(ToString ts)
{
ts.setSingleline();
}
- Author:
- Christos KK Loverdos
prepareToStringAware
void prepareToStringAware(ToString ts)
Copyright © 1999-2007 Christos KK Loverdos. All Rights Reserved.