Class Object

Summary

Package:
lang
File:
object.icn
Methods:
Type, className, clone, equals, fieldNames, genMethods, getField, get_class, get_class_name, get_id, hasField, hasMethod, hash_code, instanceOf, invoke, is_instance, setField, to_string

Source code.

Details
Constructor

Object()

Methods:

Type()

Generates:
the name of the current class followed by all classes that it inherits from.


className()

Returns:
the classname for the current class in package::class format


clone(seen)


 Clone the object.


equals(other, seen)


 Test equality of this object with another


fieldNames()

Generates:
the names of all fieldsmof an object

This now depends on lang::generate_member_names procedure which is no longer dependent on the implementation details, but uses one of the Unicon functions membernames().


genMethods()

Generates:
the names of all methods

What methods are available for this class? remove implementation dependency and instead use Unicon function for this information.


getField(fName)

Returns:
the value of the fName field

Produce the value of the named field. Fails if no such field.

name of field


get_class()


 Get the Class object for this object


get_class_name()


 Return the class name as a string, e.g. lang__Object.
 This method is deprecated. Consider using method className().


get_id()


 Return the class instance number


hasField(fName)

Returns:
fName
Fails:
if no field fName

Does this class have a specific field?

name of possible field


hasMethod(mName)

Returns:
mName
Fails:
if no method mName exists

Does this class have a specific method?

Method name to check for.


hash_code(depth, seen)


 Return a hash code for the object


instanceOf(superClassname)

Returns:
the class if it's an instance of superClassname
Fails:
otherwise

Is this class a subclass of another one?

class name to check as superclass


invoke(mName, args)

Parameters:
mName
Name of method to call
args
Returns:
the outcome of the invocation
Fails:
if no method exists with that name

Invoke a class method by name.

Remaining arguments are arguments to call


is_instance(name)


 Succeed if and only if this object is an instance of class with the
 given name.
 This method is deprecated. Consider using method instanceOf().


setField(fName, value)

Parameters:
fName
name of field
value
Returns:
value
Fails:
if no field fName

Set the value of the named field.

value to set field to


to_string(depth, seen)


 Return a string representation of the oject.



This page produced by UniDoc on 2021/04/15 @ 23:59:53.