| @@ 153-171 (lines=19) @@ | ||
| 150 | /** |
|
| 151 | * {@inheritDoc} |
|
| 152 | */ |
|
| 153 | public function indexOf($data) { |
|
| 154 | if($this->head === null) { |
|
| 155 | return false; |
|
| 156 | } |
|
| 157 | ||
| 158 | $current = $this->head; |
|
| 159 | $i = 0; |
|
| 160 | ||
| 161 | while($i < $this->size) { |
|
| 162 | if($current->data === $data) { |
|
| 163 | return $i; |
|
| 164 | } |
|
| 165 | ||
| 166 | $current = $current->next; |
|
| 167 | $i++; |
|
| 168 | } |
|
| 169 | ||
| 170 | return false; |
|
| 171 | } |
|
| 172 | ||
| 173 | /** |
|
| 174 | * {@inheritDoc} |
|
| @@ 214-232 (lines=19) @@ | ||
| 211 | /** |
|
| 212 | * {@inheritDoc} |
|
| 213 | */ |
|
| 214 | public function indexOf($data) { |
|
| 215 | if($this->head === null) { |
|
| 216 | return false; |
|
| 217 | } |
|
| 218 | ||
| 219 | $current = $this->head; |
|
| 220 | $i = 0; |
|
| 221 | ||
| 222 | while($i < $this->size) { |
|
| 223 | if($current->data === $data) { |
|
| 224 | return $i; |
|
| 225 | } |
|
| 226 | ||
| 227 | $current = $current->next; |
|
| 228 | $i++; |
|
| 229 | } |
|
| 230 | ||
| 231 | return false; |
|
| 232 | } |
|
| 233 | ||
| 234 | /** |
|
| 235 | * {@inheritDoc} |
|
| @@ 116-134 (lines=19) @@ | ||
| 113 | /** |
|
| 114 | * {@inheritDoc} |
|
| 115 | */ |
|
| 116 | public function indexOf($data) { |
|
| 117 | if($this->head === null) { |
|
| 118 | return false; |
|
| 119 | } |
|
| 120 | ||
| 121 | $current = $this->head; |
|
| 122 | $i = 0; |
|
| 123 | ||
| 124 | while($i < $this->size) { |
|
| 125 | if($current->data === $data) { |
|
| 126 | return $i; |
|
| 127 | } |
|
| 128 | ||
| 129 | $current = $current->next; |
|
| 130 | $i++; |
|
| 131 | } |
|
| 132 | ||
| 133 | return false; |
|
| 134 | } |
|
| 135 | ||
| 136 | /** |
|
| 137 | * {@inheritDoc} |
|