XDict is a module of AppleScript to provides associative list type data collection. The associateve list is a collection of pairs of keys and values.
AppleScript's record class is similar to the associative list.But record object can do followings :
XDict allows to avoid these limitations.
The method to search keys in XDict is linear search. This means large number of keys cause to make performance slowdown. A few hundred of keys may not be serious problems.A few thousand of keys will cause low performance.
On the other hand, any kind of objects (not only text) can be accept as keys,for example object spefifiers and script objects and records.
Make an empty XDict instance
Make a new XDict instance with a list of pair lists of a key and a value.
Make a XDict instance with a list of keys and a list of values.
Make a XDict instance with a XList of keys and a XList of values.
Obtain a value associated with a specified key. If a key is not in a XDict, error number 900 will be rasied.
Obtain a key associating a value. If a same value using "is" operator is not found, missing value is returened.
Set a value associated with a key. If the key is not in the XDict, the key is added.
Chack whether a passed value is icluded as a key value or not.
Remove a specified key and a associated value.
Obtain all keys as a list
Obtain all values as a list
Obtain all keys as a list
Remove all keys and values
Set a key comparator script to the instance.
Set a value comparator script to the instance.
Obrain the key comprator of the XDict instance.
Obrain the value comprator of the XDict instance.
Make an iterator object of XDict. The iterator object return a pair list of key and a value i.e. {a_key, a_value} with next() handler.
Check whether next object can be obtained or not.
Obtain a next pair of a key and its value.
Make a pair of a key and a value retuned by next() revert to first one.
Perform do handler of given script object with passing pair lists of each key and value as a argument.
Perform do handler of given script object with passing pair lists of each key and value as a argument. A XList consisting of the results of do handler is returned.
Almost same to map, but a result of this method is AppleScript's list.
Dump keys and values in XDict as text. Use this method for debugging.