class Table
Base class:
Object Inherited classes: Empty
Description: represents a table of objects, which are held as pairs of key and value.
- Fields:
- Empty
- Methods:
- null(): Clears the table - removes all elements.
- copy(): Returns a deep copy of the table
- get(): Retunes the value that corresponds the given key in the table, and null if the key does not exist
- has_key(): Returns true if the given parameter exists as key in the table and false otherwise
- has_value(): Returns true if the given parameter exists as value in the table and false otherwise
- keys(): Returns a list of keys of this table
- length(): Returns the table length
- pairs(): Returns two lists: list of keys in the table, and list of the corresponding values
- pop(): Pops and returns the first pair from the table
- read(): Reads the table content from the file which its name is given as a parameter in text mode
- null(): Removes from this table the given key and its corresponding value from the table
- update(): Updates the current table elements by the given table: for each pair in the given table, if the key exists in the current table update its value, otherwise add this pair.
- null(): Returns the value list of this table by their key order.
- write(): Writes the table content into the file which its name is given as a parameter in text mode
- Events:
- Empty
Back to Mama reference