Domain is the basic managed object for Ponder2 that supports hierarchies. View it like a directory or a folder in a filesystem
Operation | Return | Description |
has: name |
boolean |
returns true if named object exists within the domain |
asHash |
P2Hash |
Returns a hash containing all the entries in the domain as name->object pairs |
at: aName |
P2Object |
answers the P2Object of the Managed Object at aName. Answers NIL if the object does not exist. |
at: aName ifAbsent: aBlock |
P2Object |
Answer the P2Object associated with aName. If not found evaluate aBlock (with no arguments) and return its result |
at: aName put: p2Object |
P2Object |
add anOid into the domain with aName. Answers anOid. |
collect: aBlock |
P2Array |
Calls aBlock with name/value pairs for each entry in the domain. Answers with an array with all the answers from the executions |
do: aBlock |
self |
Calls aBlock with name/value pairs for each entry in the domain. Answers with the the receiver |
listNames |
P2Object |
answers an array containing the names of all the domain's entries. |
listObjects |
P2Object |
answers an array of Managed Object names containing all the entries in the domain. |
remove: aName |
P2Object |
Removes aName and its P2ManagedObject from the domain. Answers the oid. TODO Error checks? |
resolve: aPath |
P2Object |
Answers with the object from aPath relative to this domain |