@@ -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 |
@@ -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). |
@@ -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 |
@@ -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 |
@@ -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. |
@@ -1,11 +1,10 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | namespace Jmw\Collection\Map; |
| 3 | 3 | |
| 4 | -use Jmw\Collection\Set\SetAbstract; |
|
| 4 | +use Jmw\Collection\Exception\UnsupportedOperationException; |
|
| 5 | 5 | use Jmw\Collection\Lists\ArrayList; |
| 6 | -use Jmw\Collection\Set\TupleSet; |
|
| 7 | 6 | use Jmw\Collection\Set\ArraySet; |
| 8 | -use Jmw\Collection\Exception\UnsupportedOperationException; |
|
| 7 | +use Jmw\Collection\Set\TupleSet; |
|
| 9 | 8 | /** |
| 10 | 9 | * Hash table based implementation of the Map interface. |
| 11 | 10 | * This implementation provides all of the optional map operations, |
@@ -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 significantly faster |
|
| 10 | - * @author john |
|
| 11 | - * |
|
| 12 | - */ |
|
| 4 | + |
|
| 13 | 5 | class ArraySet extends SetAbstract |
| 14 | 6 | { |
| 15 | 7 | /** |