src.pydasa.structs.tables.htme#
Module to represent the MapEntry data structure for the Hash Table in PyDASA.
- classes:
MapEntry: Represents a key-value pair in a hash table with type validation and error handling.
IMPORTANT: based on the implementations proposed by the following authors/books:
# . Algorithms, 4th Edition, Robert Sedgewick and Kevin Wayne. # . Data Structure and Algorithms in Python, M.T. Goodrich, R. Tamassia, M.H. Goldwasser.
Classes#
MapEntry class for creating a map entry in the Hash Table. Fundamental for the Hash Table data structure. |
Module Contents#
- class src.pydasa.structs.tables.htme.MapEntry#
Bases:
Generic[pydasa.structs.types.generics.T]MapEntry class for creating a map entry in the Hash Table. Fundamental for the Hash Table data structure.
- Parameters:
Generic (T) – Generic type for a Python data structure.
- Returns:
- A map entry object with the following attributes:
_key: The key of the map entry.
_value: The value of the map entry.
- Return type:
- _error_handler(err)#
_error_handler() to process the context (package/class), function name (method), and the error (exception) that was raised to format a detailed error message and traceback.
- Parameters:
err (Exception) – Python raised exception.
- Return type:
None
- _validate_key_type(key)#
_validate_key_type() checks if the type of the key is the same as the type of the MapEntry.
- _validate_value_type(value)#
_validate_value_type() checks if the type of the value is the same as the type of the MapEntry.