1 | <?php |
||
11 | class ArrayList extends AbstractList { |
||
12 | |||
13 | /** |
||
14 | * Creates a new ArrayList |
||
15 | * |
||
16 | * @param array|Iterator $collection |
||
17 | */ |
||
18 | 24 | public function __construct($collection = []) { |
|
21 | |||
22 | /** |
||
23 | * Adds an element to that list |
||
24 | * |
||
25 | * @param mixed $element |
||
26 | * @param int $index |
||
27 | * @return $this |
||
28 | */ |
||
29 | 24 | public function add($element, $index = null) { |
|
38 | |||
39 | /** |
||
40 | * Adds all elements to the list |
||
41 | * |
||
42 | * @param array|Iterator $collection |
||
43 | * @return $this |
||
44 | */ |
||
45 | 24 | public function addAll($collection) { |
|
52 | |||
53 | /** |
||
54 | * Removes an element from the list |
||
55 | * |
||
56 | * @param mixed $element |
||
57 | * @return $this |
||
58 | */ |
||
59 | 2 | public function remove($element) { |
|
67 | |||
68 | /** |
||
69 | * Removes all elements from the list |
||
70 | * |
||
71 | * @param array|Iterator $collection |
||
72 | * @return $this |
||
73 | */ |
||
74 | 2 | public function removeAll($collection) { |
|
81 | |||
82 | } |
||
83 |