1 | <?php |
||
8 | final class AdjacencyList implements \ArrayAccess, \IteratorAggregate |
||
9 | { |
||
10 | /** |
||
11 | * @var array |
||
12 | */ |
||
13 | private $container = []; |
||
14 | |||
15 | /** |
||
16 | * AdjacencyList constructor. |
||
17 | * |
||
18 | * @param array $edges |
||
19 | */ |
||
20 | public function __construct(array $edges = []) |
||
46 | |||
47 | /** |
||
48 | * @param mixed $offset |
||
49 | * @param mixed $value |
||
50 | */ |
||
51 | public function offsetSet($offset, $value) |
||
55 | |||
56 | /** |
||
57 | * @param mixed $offset |
||
58 | * |
||
59 | * @return bool |
||
60 | */ |
||
61 | public function offsetExists($offset) |
||
65 | |||
66 | /** |
||
67 | * @param mixed $offset |
||
68 | */ |
||
69 | public function offsetUnset($offset) |
||
73 | |||
74 | /** |
||
75 | * @param mixed $offset |
||
76 | * |
||
77 | * @return mixed|null |
||
78 | */ |
||
79 | public function offsetGet($offset) |
||
83 | |||
84 | /** |
||
85 | * Retrieve an external iterator. |
||
86 | * |
||
87 | * @return \Traversable |
||
88 | */ |
||
89 | public function getIterator() |
||
93 | } |
||
94 |