@@ -122,7 +122,7 @@ |
||
122 | 122 | |
123 | 123 | /** |
124 | 124 | * Returns an iterator over the elements in this list in proper sequence. |
125 | - * @return IteratorInterface |
|
125 | + * @return ListIterator |
|
126 | 126 | */ |
127 | 127 | public function iterator() |
128 | 128 | { |
@@ -1,10 +1,10 @@ |
||
1 | 1 | <?php |
2 | 2 | namespace Jmw\Collection\Lists; |
3 | 3 | |
4 | +use Jmw\Collection\CollectionAbstract; |
|
4 | 5 | use Jmw\Collection\CollectionInterface; |
5 | -use Jmw\Collection\Exception\InvalidTypeException; |
|
6 | 6 | use Jmw\Collection\Exception\IndexOutOfBoundsException; |
7 | -use Jmw\Collection\CollectionAbstract; |
|
7 | +use Jmw\Collection\Exception\InvalidTypeException; |
|
8 | 8 | |
9 | 9 | /** |
10 | 10 | * This is the most generic collection type |
@@ -1,8 +1,8 @@ |
||
1 | 1 | <?php |
2 | 2 | namespace Jmw\Collection\Lists; |
3 | 3 | |
4 | -use Jmw\Collection\ImmutableCollectionTrait; |
|
5 | 4 | use Jmw\Collection\Exception\UnsupportedOperationException; |
5 | +use Jmw\Collection\ImmutableCollectionTrait; |
|
6 | 6 | /** |
7 | 7 | * This trait is ensures immutability by throwing an exception |
8 | 8 | * on all mutable ListInterface methods |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | |
66 | 66 | /** |
67 | 67 | * Returns a Set view of the mappings contained in this map. |
68 | - * @return SetInterface |
|
68 | + * @return TupleSet |
|
69 | 69 | */ |
70 | 70 | public function entrySet() |
71 | 71 | { |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | |
116 | 116 | /** |
117 | 117 | * Returns a Set view of the keys contained in this map. |
118 | - * @return SetInterface |
|
118 | + * @return ArraySet |
|
119 | 119 | */ |
120 | 120 | public function keySet() |
121 | 121 | { |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | * It returns the previous value associated with key, |
152 | 152 | * or null if there was no mapping for key. |
153 | 153 | * (A null return can also indicate that the map previously associated null with key.) |
154 | - * @param unknown $key |
|
154 | + * @param string $key |
|
155 | 155 | * @return multitype $value | null |
156 | 156 | */ |
157 | 157 | public function remove($key) |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | |
181 | 181 | /** |
182 | 182 | * Returns a Collection view of the values contained in this map. |
183 | - * @return CollectionInterface |
|
183 | + * @return ArrayList |
|
184 | 184 | */ |
185 | 185 | public function values() |
186 | 186 | { |
@@ -1,10 +1,9 @@ |
||
1 | 1 | <?php |
2 | 2 | namespace Jmw\Collection\Map; |
3 | 3 | |
4 | -use Jmw\Collection\Set\SetAbstract; |
|
5 | 4 | use Jmw\Collection\Lists\ArrayList; |
6 | -use Jmw\Collection\Set\TupleSet; |
|
7 | 5 | use Jmw\Collection\Set\ArraySet; |
6 | +use Jmw\Collection\Set\TupleSet; |
|
8 | 7 | /** |
9 | 8 | * Hash table based implementation of the Map interface. |
10 | 9 | * This implementation provides all of the optional map operations, |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | |
57 | 57 | /** |
58 | 58 | * Returns an iterator over the elements in this collection. |
59 | - * @return IteratorInterface |
|
59 | + * @return SetIterator |
|
60 | 60 | */ |
61 | 61 | public function iterator() |
62 | 62 | { |
@@ -65,7 +65,6 @@ discard block |
||
65 | 65 | |
66 | 66 | /** |
67 | 67 | * Removes a single instance of the specified element from this collection, if it is present (optional operation). |
68 | - * @param boolean $changed |
|
69 | 68 | */ |
70 | 69 | public function remove($element) |
71 | 70 | { |
@@ -1,15 +1,7 @@ |
||
1 | 1 | <?php |
2 | 2 | namespace Jmw\Collection\Set; |
3 | 3 | |
4 | -use Jmw\Collection\Lists\Tuple; |
|
5 | -use Jmw\Collection\Lists\ArrayList; |
|
6 | -/** |
|
7 | - * An implementation of a Set using a php array |
|
8 | - * It is advisable to use a HashSet in most instances, |
|
9 | - * as it is faster |
|
10 | - * @author john |
|
11 | - * |
|
12 | - */ |
|
4 | + |
|
13 | 5 | class ArraySet extends SetAbstract |
14 | 6 | { |
15 | 7 | /** |
@@ -75,7 +75,7 @@ |
||
75 | 75 | |
76 | 76 | /** |
77 | 77 | * Returns an iterator over the elements in this collection. |
78 | - * @return IteratorInterface |
|
78 | + * @return SetIterator |
|
79 | 79 | */ |
80 | 80 | public function iterator() |
81 | 81 | { |
@@ -1,8 +1,8 @@ |
||
1 | 1 | <?php |
2 | 2 | namespace Jmw\Collection\Set; |
3 | 3 | |
4 | -use Jmw\Collection\Map\HashMap; |
|
5 | 4 | use Jmw\Collection\Lists\ArrayList; |
5 | +use Jmw\Collection\Map\HashMap; |
|
6 | 6 | |
7 | 7 | /** |
8 | 8 | * This class implements the Set interface, backed by a hash table (actually a HashMap instance). |
@@ -82,7 +82,7 @@ |
||
82 | 82 | * The behavior of an iterator is unspecified if the underlying |
83 | 83 | * collection is modified while the iteration is in progress in any |
84 | 84 | * way other than by calling this method. |
85 | - * @return boolean |
|
85 | + * @return boolean|null |
|
86 | 86 | */ |
87 | 87 | public function remove() |
88 | 88 | { |
@@ -1,9 +1,9 @@ |
||
1 | 1 | <?php |
2 | 2 | namespace Jmw\Collection\Set; |
3 | 3 | |
4 | -use Jmw\Collection\IteratorInterface; |
|
5 | -use Jmw\Collection\Exception\NoSuchElementException; |
|
6 | 4 | use Jmw\Collection\Exception\IllegalStateException; |
5 | +use Jmw\Collection\Exception\NoSuchElementException; |
|
6 | +use Jmw\Collection\IteratorInterface; |
|
7 | 7 | |
8 | 8 | /** |
9 | 9 | * An iterator on a set. It uses an array to keep track |
@@ -30,8 +30,8 @@ discard block |
||
30 | 30 | |
31 | 31 | /** |
32 | 32 | * Ensures that this collection contains the specified element (optional operation). |
33 | - * @param multitype $element |
|
34 | - * @return boolean |
|
33 | + * @param Tuple $element |
|
34 | + * @return boolean|null |
|
35 | 35 | */ |
36 | 36 | public function add($element) |
37 | 37 | { |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | |
62 | 62 | /** |
63 | 63 | * Returns an iterator over the elements in this collection. |
64 | - * @return IteratorInterface |
|
64 | + * @return SetIterator |
|
65 | 65 | */ |
66 | 66 | public function iterator() |
67 | 67 | { |
@@ -70,7 +70,6 @@ discard block |
||
70 | 70 | |
71 | 71 | /** |
72 | 72 | * Removes a single instance of the specified element from this collection, if it is present (optional operation). |
73 | - * @param boolean $changed |
|
74 | 73 | */ |
75 | 74 | public function remove($tuple) |
76 | 75 | { |
@@ -1,9 +1,9 @@ |
||
1 | 1 | <?php |
2 | 2 | namespace Jmw\Collection\Set; |
3 | 3 | |
4 | -use Jmw\Collection\Lists\Tuple; |
|
5 | 4 | use Jmw\Collection\Exception\InvalidTypeException; |
6 | 5 | use Jmw\Collection\Lists\ArrayList; |
6 | +use Jmw\Collection\Lists\Tuple; |
|
7 | 7 | /** |
8 | 8 | * A set of Tuple elements, which ensures that only Tuple elements |
9 | 9 | * may be added to the set, and no Tuple element may be duplicated |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | |
128 | 128 | /** |
129 | 129 | * Adds child to the receiver at index. |
130 | - * @param TreeNodeInterface $nodex |
|
130 | + * @param TreeNodeInterface $node |
|
131 | 131 | * @return void |
132 | 132 | */ |
133 | 133 | public function insert(TreeNodeInterface $node) |
@@ -221,7 +221,7 @@ discard block |
||
221 | 221 | /** |
222 | 222 | * Outputs to stdout a simplistic representation of this node and |
223 | 223 | * it's children |
224 | - * @param number $level |
|
224 | + * @param integer $level |
|
225 | 225 | */ |
226 | 226 | public function printTree($level = 0) |
227 | 227 | { |
@@ -1,8 +1,8 @@ |
||
1 | 1 | <?php |
2 | 2 | namespace Jmw\Collection\Tree; |
3 | 3 | |
4 | -use Jmw\Collection\Lists\ListInterface; |
|
5 | 4 | use Jmw\Collection\Lists\ArrayList; |
5 | +use Jmw\Collection\Lists\ListInterface; |
|
6 | 6 | |
7 | 7 | /** |
8 | 8 | * Simple implementation of a tree node. |