Next: , Up: Core Methods



5.1.1 MozBase Methods

— Method on MozBase: init ozName storageRef serverRef languageStringsObjectRef

Initializes the attributes storageRef, serverRef and languageStringsObjectRef and the feature ozName to the values passed.

— Method on MozBase: start

None Does nothing; here to be over-ridden in other classes.

— Method on MozBase: stop

None Does nothing; here to be over-ridden in other classes.

— Method on MozBase: ozName ozName

Returns the Oz Name associated with the current object in the passed variable. Would normally be named getOzName, but this method is used very frequently, and the value can't be changed so there would be no corresponding setOzName anyways.

— Method on MozBase: className className

Returns the Oz Name associated with the current object in the passed variable. Would normally be named getClassName, but this method is used very frequently, and the value shouldn't be changed so there would be no corresponding setClassName anyways.

— Method on MozBase: toRecord record

toRecord is a very important method that runs through the elements of the exports feature and constructs a record using the information therein. This record can be pickled, saved to disk, and later loaded in with fromRecord.

— Method on MozBase: fromRecord record convert objectRef

fromRecord is the inverse operation to toRecord. It takes the output of toRecord and sets attributes appropriately. Note that this is a pure procedure: it is only called for its side effects. convert is the procedure to convert stored attributes of type objectRef into something useful, gotten from the Storage object. objectRef is used to return an object reference to the newly initialized object, with all capabilities.

— Method on MozBase: revoke method capability newCapability

Revokes the current capability on the given method, assuming that the argument capability matches it. The new capability on that method is returned in newCapability.

— Method on MozBase: hasProperName hasProperName

Returns a boolean declaring if the object's name is a proper name (like Alice or Bob) or a generic name (like couch or door or puppy).

— Method on MozBase: setHasProperName hasProperName

Sets the hasProperName to true or false.

— Method on MozBase: addVerb language verb parse

Adds a verb to the objects verbs record, dealing with things like over-writing the same verb parse, dealing with multiple parses of the same verb, and the fact that the whole verb record system is very baroque.

language
The language the verb applies in.
verb
The verb word itself ("help", "look", whatever).
parse
The parse record to add. Note that this record will over-ride any other parse record for the same verb with the same label, so it's important that it be reasonably unique.

— Method on MozBase: getName name

Standard variable get.

— Method on MozBase: getArticledName name

Returns the object's name with the appropriate article in front of it.

— Method on MozBase: getArticledStarterName name

Like getArticledName, but adjusts for the article being the first word of a sentence if a language requires that.

— Method on MozBase: setName name

Standard variable set.

— Method on MozBase: getVerbs verbs

Standard variable get.

— Method on MozBase: deLocalize inputString outputString language

Returns a bare string from a localized string, based on a language argument.

Arguments:

inputString
The string to be de-localized, in string( lang: <string> ) format as usual.
outputString
A normal Oz string.
language
Optional, the language to de-localize into.
— Method on MozBase: selfMatch string certainty language

The object returns a certainty, as a value from 0 to 1, that it is the object being referred to by the string in question. The string should be localized.

Possible Certainty Values:

1.0
A perfect string match, including case.
0.9
Matches only after converting both strings to lower case (i.e. a caseless match).
— Method on MozBase: addPublicMethod method

Adds the given atom to the list of public methods for this object (i.e. methods for which capabilities are given out freely).

— Method on MozBase: enhanceStorage storageRef

Adds the capabilities on the given storageRef to the object's current capability set for the Storage object.

— Method on MozBase: selfReference selfRef

Returns a complete reference for the current object, including all capabilities. Very insecure!

— Method on MozBase: publicSelfReference selfRef

Returns a complete reference for the current object, with capabilities for only the methods in publicMethods.

— Method on MozBase: printedList stringList string

Takes the list of strings in stringList and concatenates them together as might be expected in a natural language string (i.e. in English, using commas and "and").

— Method on MozBase: printedObjectList objectList string

Like printedList, but the list is a list of object references, from which names are extracted.