Hash_Tables
Versatile implementation of hash tables.
• Generic to allow all kinds of content.
• Variable size (always prime).
 |  | type Key_Type |  |
 | Generic type of keys to access items. |  |
 |  | type Item_Type |  |
 | Generic type of the items to be stored. |  |
 |  | type Hash_Table |  |
 | Instance of a hash table.
No need to call a constructor. Uninitialized hash tables behave
like regular empty ones. |  |
 |  | exception Key_Exists |  |
 | The given key already exists in the hash table.
Raised by Put(Hash_Table, Key_Type, Item_Type). |  |
 |  | procedure Put |  |
 | Check for available space in the table, grow if necessary, then
insert the key item pair into the table.
Raises Key_Exists if the key is already in use. |  |
|
 |  | procedure Get |  |
 | Retrieve an item from the table.
Output parameter Found tells you whether the item was found in
the table. |  |
|
 |  | exception Key_Not_Found |  |
 | The given key was not found in the hash table.
Raised by Get(Hash_Table, Key_Type). |  |
 |  | function Get |  |
 | Retrieve an item from the table.
Raises Key_Not_Found if the key is not in the table. |  |
|
 |  | procedure Get_Next |  |
 | Iterate over the items in the table.
You should start with an Index of 0 and stop iterating as soon
as Index is 0 again. |  |
|
 |  | procedure Print_Usage |  |
 | Print a visual representation of the hash table's usage.
Empty fields are represented by a '-' character, used fields by
'#'. |  |
|
|