1 | <?php namespace GenericCollections\Internal; |
||
17 | class DoubleLinkedList extends \SplDoublyLinkedList |
||
18 | { |
||
19 | /** |
||
20 | * Set if the search inside the storage must be identical (true) or equal (false) |
||
21 | * |
||
22 | * @var bool |
||
23 | */ |
||
24 | private $strict = true; |
||
25 | |||
26 | 3 | public function strictComparisonOn() |
|
30 | |||
31 | 15 | public function strictComparisonOff() |
|
35 | |||
36 | 6 | public function getStrictComparison() |
|
40 | |||
41 | |||
42 | /** |
||
43 | * Returns TRUE if the element exist in the storage |
||
44 | * |
||
45 | * @param mixed $element |
||
46 | * @return bool |
||
47 | */ |
||
48 | 33 | public function contains($element) |
|
52 | |||
53 | /** |
||
54 | * Perform a linear search inside the storage, |
||
55 | * because the elements contained are not sorted. |
||
56 | * |
||
57 | * Return the index of the element found, -1 if not found |
||
58 | * |
||
59 | * @param $element |
||
60 | * @return int |
||
61 | */ |
||
62 | 39 | public function search($element) |
|
75 | |||
76 | /** |
||
77 | * Clear the contents of the container |
||
78 | * |
||
79 | * There is a bug & patch for SplDoublyLinkedList https://bugs.php.net/bug.php?id=60759 |
||
80 | * that does the same operation (pop until count == 0) |
||
81 | */ |
||
82 | 3 | public function clear() |
|
88 | } |
||
89 |