Object (class)
public abstract shared Object
Package: CURL.LANGUAGE.CORE-TYPES

The base class for all classes: types created with define-class.


Methods
object-describe:Describes an object in a way that is suitable for printing by the user.
public {Object.object-describe
    out:TextOutputStream,
    locale:Locale
}:void
object-describe-for-debugging:Describes an object in some detail; intended to be used mostly for debugging purposes.
public {Object.object-describe-for-debugging
    out:TextOutputStream,
    locale:Locale
}:void
object-serialize:Called by the serialization code when a class instance is to be written.
public {Object.object-serialize out:SerializeOutputStream}:void

Method Details
object-describe (method)
public {Object.object-describe
    out:TextOutputStream,
    locale:Locale
}:void

Describes an object in a way that is suitable for printing by the user.

out: The stream to which the characters are sent.
locale: The Locale that controls how self is displayed.

Description

This method is generally invoked indirectly using the "%s" format key.

{format out = out, "%s", obj}
simply calls
{obj.object-describe out}.


For example, if u is a Url,
{u.object-describe os}
writes u's name to os.

The default implementation of this method has the effect of calling
{format out = out, locale = locale, "%v", obj }
(see format for details about the "%v" format key).


object-describe-for-debugging (method)
public {Object.object-describe-for-debugging
    out:TextOutputStream,
    locale:Locale
}:void

Describes an object in some detail; intended to be used mostly for debugging purposes.

out: The stream to which the characters are sent.
locale: The Locale that controls how self is displayed.

Description

This method is generally invoked indirectly using the "%y" format key. The "%y" format key wraps the result produced by this method with some type/address information -- something like:

{do
    let buf:StringBuf = {StringBuf}
    {self.object-describe-for-debugging buf, {get-syntax-locale}}
    {format out = out, "[ @ %s]", buf}
}


The default implementation of this method calls
{format out = out, "%w", self}.
(see format for details about the "%w" format key).

If that gets a FormatFailedException, as it normally will for user-defined classes, this method falls back on calling the object-describe method.


object-serialize (method)
public {Object.object-serialize out:SerializeOutputStream}:void

Called by the serialization code when a class instance is to be written.

out: The SerializeOutputStream that called this method.

Description

This method must do the following steps, in order:

  1. It must call SerializeOutputStream.write-class-version, normally with an argument of zero.
  2. It must call super.object-serialize for each serializable superclass.
  3. It must write its serialized state to out. This is normally done by calling SerializeOutputStream.write-one for each field.

Notes

This method should only be defined by serializable subclasses.