Object (class instance) type basic object model metaclass.
class Object \ from BOM
apply() | Applies the values in a dictionary to the corresponding properties. |
attributes() | Returns a dictionary containing annotation attributes of the given object. |
getProperty() | Returns the value of a property in an object. |
properties() | Returns all the properties in the object. |
retrieve() | Gets the values stored in the properties of this object. |
setProperty() | Sets the value of a proprety in this object |
add__ from BOM | Overrides binary addition operand. |
baseClass from BOM | Returns the class item from which an object has been instantiated. |
call__ from BOM | Overrides call operator "self()". |
className from BOM | Returns the name of the class an instance is instantiated from. |
clone from BOM | Performs a deep copy of the item. |
compare from BOM | Performs a lexicographical comparison. |
dec__ from BOM | Overrides decrement unary prefix operand. |
decpost__ from BOM | Overrides decrement unary postfix operand. |
derivedFrom from BOM | Checks if this item has a given parent. |
describe from BOM | Returns the deep contents of an item on a string representation. |
div__ from BOM | Overrides binary division operand. |
getIndex__ from BOM | Overrides array access operator [] |
inc__ from BOM | Overrides increment unary prefix operand. |
incpost__ from BOM | Overrides increment unary postifx operand. |
isCallable from BOM | Determines if an item is callable. |
len from BOM | Retreives the lenght of a collection |
metaclass from BOM | Returns the metaclass associated with this item. |
mod__ from BOM | Overrides modulo operand. |
mul__ from BOM | Overrides binary multiplication operand. |
pow__ from BOM | Overrides power operand. |
ptr from BOM | Returns a raw memory pointer out of this data (as an integer). |
serialize from BOM | Serialize the item on a stream for persistent storage. |
setIndex__ from BOM | Overrides array write operator [] |
sub__ from BOM | Overrides binary subtraction operand. |
toString from BOM | Coverts the object to string. |
typeId from BOM | Returns an integer indicating the type of this item. |
Applies the values in a dictionary to the corresponding properties.
Object.apply( dict )
dict | A "stamp" dictionary. | ||
Returns: | This same object. | ||
Raises: |
|
This method applies a "stamp" on this object. The idea is that of copying the contents of all the items in the dictionary into the properties of this object. Dictionaries are more flexible than objects, at times they are preferred for i.e. network operations and key/value databases. With this method, you can transfer data from a dictionary in an object with a single VM step, paying just the cost of the copy; in other words, sparing the VM operations needed for looping over the dictionary and searching dynamically the required properties.
Note: Non-string keys in dict are simply skipped.
Returns a dictionary containing annotation attributes of the given object.
Object.attributes( )
Returns: | Nil if the object has no attributes, or a string-indexed dictionary. |
If the object is a class instance, this method will return the attributes of the generator class.
Returns the value of a property in an object.
Object.getProperty( propName )
propName | A string representing the name of a property or a method inside the object. | ||
Returns: | the property | ||
Raises: |
|
An item representing the property is returned. The returned value is actually a copy of the property; assigning a new value to it won't have any effect on the original object.
If the property is a method, a callable method item is returned. If the property is not found, an error of class RangeError is raised.
Returns all the properties in the object.
Object.properties( )
Returns: | An array of strings representing property names. |
This method returns all the properties in this object.
The property list includes properties that refer to any kind of data, including functions (that is, methods), but it doesn't include properties in the metaclass of this item (FBOM properties).
The returned list is ordered by UNICODE value of the property names.
Note: Subclasses are seen as properties, so they will returned in the list too.
Gets the values stored in the properties of this object.
Object.retrieve( [dict] )
dict | A "stamp" dictionary. | ||
Returns: | A dictionary containing the contents of each property (stored as a key in the dictionary). | ||
Raises: |
|
This method takes all the data values stored in the properties of this object (ignoring methods), and places them in a dictionary. Property names are used as keys under which to store flat copies of the property values.
If a dict parameter is passed, this method will take only the properties stored as keys, and eventually raise an AccessError if some of them are not found.
Otherwise, a new dictionary will be filled with all the properties in this object.
Note: In case of repeated activity, the same dictionary can be used to fetch new values to spare memory and CPU.
Sets the value of a proprety in this object
Object.setProperty( propName, value )
propName | A string representing the name of a property or a method inside the object. | ||
value | The property new value. | ||
Raises: |
|
Alters the value of the property in the given object. If the required property is not present, an AccessError is raised.