Transforms the specified object into a string format.
Parameters: toFormat - the object to format; the caller is responsible for ensuring that the type of the passed-in object is the type expected by the subclass throws: ClassCastException - if toFormat is not of the type expected by the subclass