A table associates keys with values. Any element can be used as a key.
A table has an initial size and can support any number of values. Use 'hasKey/1'
to determine whether a table contains a key. Use 'get/1' to access a table
via a key and 'put/2' to update a table given a key and a value. Use 'keys/0'
to access the set of keys for a table.
Operations |
addDaemon(d:Element):Element |
All tables have a collection of daemons. A daemon is an operation that is
invoked whenever a table is updated. The operation is any invokable value
(either an operation or an object that implements the 'invoke/2' operation.
The invocation occurs after the table has been updated and is supplied with
the index, the new bucket and the old bucket that has changed.
|
addKeyRemovedDaemon(d:Element,actionSource:Element):Element |
Use this operation to add a daemon that monitors the removal of
keys from a table. The args of the daemon are the key that is removed
and its value in the table.
|
addKeyRemovedDaemon(d:Element):Element |
Use this operation to add a daemon that monitors the removal of
keys from a table. The args of the daemon are the key that is removed
and its value in the table.
|
addKeyValueChangedDaemon(d:Element,actionSource:Element):Element |
Use this operation to add a daemon that monitors changes in key
values. This will not fire when the key is added or when the
key is removed. The args for the daemon are the key, the new value
and the old value.
|
addKeyValueChangedDaemon(d:Element):Element |
Use this operation to add a daemon that monitors changes in key
values. This will not fire when the key is added or when the
key is removed. The args for the daemon are the key, the new value
and the old value.
|
addNewKeyDaemon(d:Element,actionSource:Element):Element |
Use this operation to add a daemon that monitors the addition of
new keys to a table. The args for the daemon are the new key
and its value.
|
addNewKeyDaemon(d:Element):Element |
Use this operation to add a daemon that monitors the addition of
new keys to a table. The args for the daemon are the new key
and its value.
|
asVector():Vector |
Returns the receiver as a vector. This is essentially
just changing the type of the receiver from table to
vector.
|
clear():Table |
Clears the table. Fires any daemons defined for the table.
|
daemonNamed(name:Element):Element | No Documentation Specified |
daemons():Element |
Get the current daemons for the table.
|
destroyDaemon(d:Daemon):Element | No Documentation Specified |
entries():Integer |
Returns the number of entries in the table.
|
fire(index:Element,newBucket:Element,oldBucket:Element):Element |
When a table is updated, its daemons are fired by calling this operation.
The operation is supplied with the bucket index, the old state of the changed
bucket and the new state of the changed bucket. The index is supplied to make
the daemon mechanism compatible with that for arrays. In most cases the index
will be of no value. The table specific daemon definition operations
hide away the index.
|
get(key:Element):Element |
Return the valueof the supplied key in the table.
If the key does not exist then an exception is
raised. Use 'hasKey/1' to check if the key exists.
|
hasDaemonNamed(name:Element):Element | No Documentation Specified |
hasKey(key:Element):Boolean |
Tests whether the table has a key or not.
|
hasValue(value:Element):Boolean |
Tests whether the table has a value or not.
|
init(args:Element):Element | No Documentation Specified |
isEmpty():Boolean | No Documentation Specified |
keys():Seq(Element) |
Returns all the keys in the table.
|
pprint():String |
This operation prints out all the entries in a table.
|
put(key:Element,value:Element):Element |
Add an association between the supplied key and value.
Any existing association for the key is removed.
|
ref(index:Integer):Element | No Documentation Specified |
remove(key:Element):Element |
Remove the supplied key from the table. This succeeds whether
the key exists in the tabel or not. Any daemons defined for the
table are performed. The table is returned.
|
removeDaemon(d:Element,target:Element):Element | No Documentation Specified |
removeDaemonNamed(name:Element):Element | No Documentation Specified |
set(index:Integer,value:Element):Element | No Documentation Specified |
setDaemons(daemons:Element):Element | No Documentation Specified |
size():Integer |
Returns the size of a table.
|
toString():String |
Returns a string representation of a table.
|
values():Set(Element) |
Returns all elements in the table as a set.
|
From Element: pprint, pprint, pprint, writeXMLFile, writeXMLFile, writeXML, lift, toSnapshot, toSnapshot, allHTMLEntries, allHTMLPackages, toHTML, writeHTML, writeHTML, writeHTMLAllEntries, writeHTMLAllPackages, writeHTMLIndex, writeHTMLOverview, yield, toString, systemId, setOf, send, save2, save, removeDaemon, removeDaemon, println, print, oclIsKindOf, oclIsTypeOf, noOperationFound, isTypeOf, isReallyKindOf, init, init, of, isKindOf, addTo, checkConstraints, copy, deleteRecursive, die, edit, equals, error, ferror, hashCode.
|