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: aName |
boolean |
returns true if the named object exists within the domain |
hasObject: anObject |
boolean |
returns true if anObject exists within the domain |
size |
int |
Answer the number of elements in 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. |
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. |
do: aBlock |
self |
Calls aBlock with name/value pairs for each entry in the domain. Answers with the the receiver |
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 |
resolve: aPath |
P2Object |
Answers with the object from aPath relative to this domain |
remove: aName |
P2Object |
Removes aName and its ManagedObject from the domain. Answers the object removed. TODO Error checks? |
removeObject: anObject |
boolean |
Removes anObject from the receiver. All copies of anObject will be removed. Answers true if one or more were removed. |
removeAll |
self |
Removes all objects from the domain. Answers the receiver. |