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

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:

MapEntry

property key: pydasa.structs.types.generics.T | None#

key Property to read the key in the MapEntry. Acts as a getter (get()) for the _key attribute.

Returns:

recovered key in the MapEntry. None if the key is not set.

Return type:

Optional[T]

property value: pydasa.structs.types.generics.T | None#

value Property to read the value in the MapEntry. Acts as a getter (get()) for the _value attribute.

Returns:

recovered value in the MapEntry. None if the value is not set.

Return type:

Optional[T]

__str__()#

__str__() function to return a string representation of the MapEntry.

Returns:

string representation of the MapEntry.

Return type:

str

__repr__()#

__repr__() function to return a string representation of the MapEntry.

Returns:

string representation of the MapEntry.

Return type:

str