ClassAttributes

ClassAttributes[class, member]
returns a list of modifiers. The given member represents a public, protected, or private member with respect to inheritance, if the list contains Public , Protected , or Private. Other possible modifiers are Static , Abstract , Final , Real , Virtual , Constant , Mutable , Property , Default , Override , and External. ClassAttributes[]
returns supported method attributes.
This loads the package.
In[1]:=
Click for copyable input
ClassAttributes are used to read out the scope of a definition in a class. There are access restrictions Private, Protected, and Public as well as the bindage attribute Static. The next class defines one field with a private scope and another bound to the class.
In[2]:=
Click for copyable input
The attributes are stored and control the usage of a class' member.
In[3]:=
Click for copyable input
Out[3]=
Out[3]=
The private member f cannot be used outside its class, while the static member g is accessed by means of its class name.
In[4]:=
Click for copyable input
Out[4]=
Out[4]=
Virtual and Real, are related to polymorphism, while Constant and Mutable control the integrity of an object. Using an object or a class as a method or indexer can be achieved ny means of Default. Finally, Transient controls the fields to be saved with Export and External allows the handling of "global" operators.
The modiefers Override, Abstract and Final modifiers as well as hold attributes for methods are described in the Scope section below.