ŒSTATE Property names and values


Currently implemented for Internal classes only.

Syntax:

    objref „ objref.ŒSTATE B
    objref „ ŒSTATE B           (Within user-defined method, same as ŒTHIS.ŒSTATE)

The monadic system method ŒSTATE returns a nested matrix of two columns, containing the names of each property in the first column, and the current value of each property in the second. It takes a right argument (0 or 1) which indicates which properties should be included in the result. If the right argument is 0, only values which differ from the default value are included. If it is 1, all properties which have a defined value are included:

      ŒCR 'Circle'
Circle {
    X„0
    Y„0
    COLOR„'Pale green'
    RADIUS„100

    ’R„Area
     R„(±1)×RADIUS*2
    ’
}

      C„ŒNEW Circle
      C.X„23
      C.Y„12
      C.ŒSTATE 0
 X 23
 Y 12
 
      C.ŒSTATE 1
 X              23
 Y              12
 COLOR  Pale green
 RADIUS        100
 
      ŒDISPLAY C.ŒSTATE 1
Ú…ÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÌ
‡ Ú…Ì                   Û
Û ÛXÛ      23           Û
Û ÀÎÙ                   Û
Û Ú…Ì                   Û
Û ÛYÛ      12           Û
Û ÀÎÙ                   Û
Û Ú…ÎÎÎÎÌ  Ú…ÎÎÎÎÎÎÎÎÎÌ Û
Û ÛCOLORÛ  ÛPale greenÛ Û
Û ÀÎÎÎÎÎÙ  ÀÎÎÎÎÎÎÎÎÎÎÙ Û
Û Ú…ÎÎÎÎÎÌ              Û
Û ÛRADIUSÛ 100          Û
Û ÀÎÎÎÎÎÎÙ              Û
À¹ÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÙ

This operation is known as serialization of an object. Note that, if any of the properties include a reference to another object, the state of that object will not be expanded (serialized) in the returned matrix. The operation is therefore a 'shallow' copy of the data.


Topic: APLX Help : Help on APL language : System Methods : ŒSTATE Property names and values
[ Previous | Next | Contents | Index ]