Try OpenEdge Now
skip to main content
Object-oriented Programming
Getting Started with Classes, Interfaces, and Objects : Using the CLASS construct : Using the root class: Progress.Lang.Object
 

Using the root class: Progress.Lang.Object

Progress.Lang.Object is an ABL built-in class definition that is the ultimate super class (root class) for all classes. In other words, if a class does not inherit from another class it implicitly inherits from Progress.Lang.Object. Thus, at the top of every class inheritance chain is the Progress.Lang.Object class.
Progress.Lang.Object is a fully implemented (non-abstract) class that provides a common set of properties and methods that are available for an instance of any class.
Note: These properties and methods provide support for class-based objects that is similar to the support provided by the ABL built-in attributes and methods on procedure object handles.
The following table describes the common properties and methods on Progress.Lang.Object.
Table 4. Progress.Lang.Object public properties and methods
Property or method
Description
PUBLIC NEXT-SIBLING AS CLASS Progress.Lang.Object
 
A read-only property that contains an object reference to the next object in the linked list of instantiated objects for the session. You use this property together with the FIRST-OBJECT attribute on the SESSION system handle in order to walk the list from the first to the last instantiated object.
PUBLIC PREV-SIBLING AS CLASS Progress.Lang.Object
 
A read-only property that contains an object reference to the previous object in the linked list of instantiated objects for the session. You use this property together with the LAST-OBJECT attribute on the SESSION system handle in order to walk the list from the last to the first instantiated object.
CONSTRUCTOR PUBLIC Object ( )
 
Constructor for this class. You can instantiate Progress.Lang.Object, but its functionality is limited to the public properties and methods defined in this table. This class is normally used to define a variable or parameter that can represent any class-based object in ABL (because all class-based objects inherit from Progress.Lang.Object).
METHOD PUBLIC CLASS Progress.Lang.Class
GetClass ( )
 
Returns an object reference to a built-in instance of Progress.Lang.Class that provides type information for the current class instance. Each ABL session contains a single instance of Progress.Lang.Class for each type of class-based object created in the session. The lifetime of this built-in object is controlled by the ABL session and therefore cannot be deleted. For more information on the built-in class, Progress.Lang.Class, see Reflection: using built-in ABL classes.
METHOD PUBLIC CHARACTER
ToString ( )
 
Returns the type name of the object followed by a unique object identifier in the ABL session. This method is normally overridden by a subclass.
METHOD PUBLIC LOGICAL Equals
( other-obj AS CLASS
Progress.Lang.Object )
 
Returns TRUE if two different object references point to the same object or are both the Unknown value (?), and returns FALSE otherwise. The two compared object references include the current object reference and the object reference specified by other-obj.
Note: This default behavior is equivalent to comparing two object references using the equals operator (EQ or =).
METHOD PUBLIC CLASS Progress.Lang.Object
Clone ( )
 
Has no default behavior and returns the Unknown value (?) and an error message if it is invoked and not overridden by a subclass. The subclass should define a method to create a copy of an object and return a reference to the new copy.
Because every object ultimately derives from Progress.Lang.Object, you can define an object reference data element with the data type Progress.Lang.Object and set it to reference any class-based object that you create in an ABL session. As with any object reference, the use of a Progress.Lang.Object object reference is limited to the properties and methods defined for Progress.Lang.Object. However, you can cast any object reference to an appropriate subclass to access functionality in that subclass. For more information on casting, see Object reference assignment and casting.