Arena
1.0
A content management system
|
A binary tree class that acts much like a Python dictionary object. More...
Public Member Functions | |
def | __init__ |
Constructor. | |
def | init |
Initializer. | |
def | implode |
Construct a string containing a list of the items in the tree, with the keys and values delimited by the specified delimiter, and the key/value pairs delimited by the specified delimiter. More... | |
def | implodeKeys |
Construct a string containing a list of the keys in the tree, with the keys separated by the specified delimiter. More... | |
def | implodeValues |
Construct a string containing a list of the values in the tree, with the values separated by the specified delimiter. More... | |
def | explode |
Expand a string that contains a list of key/value pairs into binary tree keys and values. More... | |
def | update |
Updates the dictionary to include the specified items. More... | |
def | delete |
Delete the specified item from the dictionary. More... | |
def | __getitem__ |
Retrieve the value of the specified dictionary item. More... | |
def | __setitem__ |
Set the value of the specified field. More... | |
def | __iter__ |
Iterate over the items in the dictionary. More... | |
Public Member Functions inherited from Library.Memory.BinaryTrees.ABinaryTree | |
def | __init__ |
Constructor. | |
def | init |
Initializer. | |
def | __del__ |
Destructor. | |
def | fetch |
Fetch the node with the specified key from the tree. More... | |
def | has |
Determine whether or not the specified key exists within the tree. More... | |
def | insert |
Insert the specified item into the tree. More... | |
def | delete |
Delete the specified item from the tree. More... | |
def | writeTo |
Write the tree and its nodes to the specified stream. More... | |
def | readFrom |
Read the tree from the specified stream. More... | |
def | toString |
Return a string representation of the binary tree. More... | |
def | printTo |
Print a string representation of the tree and its nodes to the specified stream. More... | |
def | census |
Retrieve the number of items in the tree. More... | |
def | keys |
Retrieve a list of keys for the item in the tree. More... | |
def | __len__ |
Return the number of items in the tree. More... | |
def | __getitem__ |
Get value of the specified item from the binary tree. More... | |
def | __delitem__ |
Delete the specified field. More... | |
def | __contains__ |
Determine whether or not the specified key exists in the binary tree. More... | |
def | __iter__ |
Iterate over the items in the tree. More... | |
Public Member Functions inherited from Library.Base.Classwork.AnObject | |
def | init |
Initialize a new object instance. More... | |
def | __init__ |
Construct and initialize a new instance of AnObject. More... | |
def | __del__ |
Destroy the object instance. More... | |
def | displayName |
Construct a "pretty" display name for the class instance, based on the name of its class. More... | |
def | implements |
Determine whether the class instance is related to the specified class. More... | |
def | toString |
Return a string representation of the class, suitable for output to a console or text-based device. More... | |
def | __str__ |
Return a string representation of the class. More... | |
def | classname |
Return the name of the class from which the instance was created. More... | |
def | name |
Return the name of the class. More... | |
Public Member Functions inherited from Library.String.Utilities.IsPrintable | |
def | toString |
Return a string representation of the class conveniently. More... | |
def | __str__ |
Return a string representation of the class. More... | |
def | printTo |
Print a string representation of the class to the specified stream. More... | |
Public Member Functions inherited from Library.IO.Streams.IsStreamable | |
def | writeTo |
Write class instance data to the specified stream. More... | |
def | readFrom |
Read class instance data from the specified stream. More... | |
A binary tree class that acts much like a Python dictionary object.
def Library.Memory.Dictionaries.ADictionary.__getitem__ | ( | Self, | |
key | |||
) |
Retrieve the value of the specified dictionary item.
This routine is provided for convenience, so that access to the items in the tree can be programmed as though the tree was a native Python dictionary object.
def Library.Memory.Dictionaries.ADictionary.__iter__ | ( | Self | ) |
Iterate over the items in the dictionary.
This method allows an instance of ADictionary to be used in a Python for..in
statement.
def Library.Memory.Dictionaries.ADictionary.__setitem__ | ( | Self, | |
key, | |||
value | |||
) |
Set the value of the specified field.
This routine is provided for convenience, so that access to the items in the tree can be programmed as though the tree was a native Python dictionary object.
def Library.Memory.Dictionaries.ADictionary.delete | ( | Self, | |
thisKey | |||
) |
Delete the specified item from the dictionary.
def Library.Memory.Dictionaries.ADictionary.explode | ( | Self, | |
thisString, | |||
itemDelimiter = dDefaultItemsDelimiter , |
|||
keyDelimiter = dDefaultKeysDelimiter |
|||
) |
Expand a string that contains a list of key/value pairs into binary tree keys and values.
The string is assumed to contain one or more items separated by the specified item delimiter, and with key/value pairs separated by the specified key delimiter.
def Library.Memory.Dictionaries.ADictionary.implode | ( | Self, | |
pairsDelimiter = dDefaultItemsDelimiter , |
|||
keysDelimiter = dDefaultKeysDelimiter |
|||
) |
Construct a string containing a list of the items in the tree, with the keys and values delimited by the specified delimiter, and the key/value pairs delimited by the specified delimiter.
def Library.Memory.Dictionaries.ADictionary.implodeKeys | ( | Self, | |
itemsDelimiter = dDefaultItemsDelimiter |
|||
) |
Construct a string containing a list of the keys in the tree, with the keys separated by the specified delimiter.
def Library.Memory.Dictionaries.ADictionary.implodeValues | ( | Self, | |
itemsDelimiter = dDefaultItemsDelimiter |
|||
) |
Construct a string containing a list of the values in the tree, with the values separated by the specified delimiter.
def Library.Memory.Dictionaries.ADictionary.update | ( | Self, | |
theseItems | |||
) |
Updates the dictionary to include the specified items.
/p theseItems must be a dictionary object, the keys of which will be used to specify token strings, and the values of which will be used to match those token strings to internal parser values.
The number of items that were successfully added to the set is returned.