Arena
1.0
A content management system
|
This class defines and implements a method to print the string representation of a class to the specified stream. More...
Public Member Functions | |
def | toString |
Return a string representation of the class conveniently. More... | |
def | __str__ |
Return a string representation of the class. More... | |
def | printTo |
Print a string representation of the class to the specified stream. More... | |
This class defines and implements a method to print the string representation of a class to the specified stream.
def Library.String.Utilities.IsPrintable.__str__ | ( | Self | ) |
Return a string representation of the class.
This method simply calls IsPrintable.toString(). It is designed to allow descendants of IsPrintable to implement the toString() method rather than the str() method, as the former is easier to type (and less ugly) than the latter.
def Library.String.Utilities.IsPrintable.printTo | ( | Self, | |
Dest | |||
) |
Print a string representation of the class to the specified stream.
Classes that adopt this interface will probably not need to override this routine; instead, they can define how their class data is represented by overriding the str() (generic objects) or toString() (descendants of AnObject) methods.
The return value of this function indicates how much information was written to the destination stream (how many characters, in this case).
def Library.String.Utilities.IsPrintable.toString | ( | Self | ) |
Return a string representation of the class conveniently.
This method is provided for convenience, as it is much more convenient and easier on the eyes than calling the inherent str() method, with all of those unsightly underscores. It can be overridden by descendant classes that wish to return something more informative than the name of their class.