| 1 | <?php |
||
| 13 | class HashMap implements \Countable, \IteratorAggregate |
||
| 14 | { |
||
| 15 | /** |
||
| 16 | * @var array |
||
| 17 | */ |
||
| 18 | private $nodes = array(); |
||
| 19 | |||
| 20 | /** |
||
| 21 | * @param Node $node |
||
| 22 | * @return $this |
||
| 23 | */ |
||
| 24 | public function attach(Node $node) |
||
| 29 | |||
| 30 | /** |
||
| 31 | * @param $key |
||
| 32 | * @return Node |
||
| 33 | */ |
||
| 34 | public function get($key) |
||
| 38 | |||
| 39 | /** |
||
| 40 | * @param $key |
||
| 41 | * @return bool |
||
| 42 | */ |
||
| 43 | public function has($key) |
||
| 47 | |||
| 48 | /** |
||
| 49 | * @return int |
||
| 50 | */ |
||
| 51 | public function count() |
||
| 55 | |||
| 56 | /** |
||
| 57 | * @return \ArrayIterator |
||
| 58 | */ |
||
| 59 | public function getIterator() |
||
| 63 | } |