formatter

class formatter #(type T =  int)

singleton Provides a strategy to convert an object of type T into a string.

Parameter

Toptional The type of an object to be converted.  The default is int.
Summary
formattersingleton Provides a strategy to convert an object of type T into a string.
Types
this_typeThe shorthand of formatter #(T).
Functions
newprotected Creates a new formatter.
get_instancestatic Returns the singleton instance of this formatter.
to_stringvirtual Returns a string representation of the given object of type T.

Types

this_type

typedef formatter#(T) this_type

The shorthand of formatter #(T).

Functions

new

protected function new()

protected Creates a new formatter.

get_instance

static function this_type get_instance()

static Returns the singleton instance of this formatter.

Returns

The singleton instance.

to_string

virtual function string to_string(o)

virtual Returns a string representation of the given object of type T.  This function should be overridden by extended classes.

Argument

oAn object to convert to a string.

Returns

A string, “obj”, is returned as a placeholder.

class formatter #(type T =  int)
singleton Provides a strategy to convert an object of type T into a string.
typedef formatter#(T) this_type
The shorthand of formatter #(T).
protected function new()
protected Creates a new formatter.
static function this_type get_instance()
static Returns the singleton instance of this formatter.
virtual function string to_string(o)
virtual Returns a string representation of the given object of type T.