package mantra.util.collections
HashMap
CLASS
public class HashMap
Associative key-value map implementation with linear probing collision resolution.
🏗️ Constructor Summary
Constructor Signature
def __init__(self)
⚙️ Method Summary
| Modifier & Return Type | Method Signature | Description |
|---|---|---|
Void |
put(key: K, value: V) |
Stores value under specified key. |
V |
get(key: K) |
Retrieves value associated with key. |
🔍 Detailed Method Specifications
pub def put(key: K, value: V) -> Void
Stores value under specified key.
pub def get(key: K) -> V
Retrieves value associated with key.
💡 Example Usage
hashmap_example.mantra
let map = HashMap()
map.put("name", "Mantra")
print(map.get("name"))