175 |
|
* @throws NullPointerException {@inheritDoc} |
176 |
|
*/ |
177 |
|
public int indexOf(Object o) { |
178 |
< |
ListIterator<E> e = listIterator(); |
178 |
> |
ListIterator<E> it = listIterator(); |
179 |
|
if (o==null) { |
180 |
< |
while (e.hasNext()) |
181 |
< |
if (e.next()==null) |
182 |
< |
return e.previousIndex(); |
180 |
> |
while (it.hasNext()) |
181 |
> |
if (it.next()==null) |
182 |
> |
return it.previousIndex(); |
183 |
|
} else { |
184 |
< |
while (e.hasNext()) |
185 |
< |
if (o.equals(e.next())) |
186 |
< |
return e.previousIndex(); |
184 |
> |
while (it.hasNext()) |
185 |
> |
if (o.equals(it.next())) |
186 |
> |
return it.previousIndex(); |
187 |
|
} |
188 |
|
return -1; |
189 |
|
} |
200 |
|
* @throws NullPointerException {@inheritDoc} |
201 |
|
*/ |
202 |
|
public int lastIndexOf(Object o) { |
203 |
< |
ListIterator<E> e = listIterator(size()); |
203 |
> |
ListIterator<E> it = listIterator(size()); |
204 |
|
if (o==null) { |
205 |
< |
while (e.hasPrevious()) |
206 |
< |
if (e.previous()==null) |
207 |
< |
return e.nextIndex(); |
205 |
> |
while (it.hasPrevious()) |
206 |
> |
if (it.previous()==null) |
207 |
> |
return it.nextIndex(); |
208 |
|
} else { |
209 |
< |
while (e.hasPrevious()) |
210 |
< |
if (o.equals(e.previous())) |
211 |
< |
return e.nextIndex(); |
209 |
> |
while (it.hasPrevious()) |
210 |
> |
if (o.equals(it.previous())) |
211 |
> |
return it.nextIndex(); |
212 |
|
} |
213 |
|
return -1; |
214 |
|
} |
517 |
|
|
518 |
|
ListIterator<E> e1 = listIterator(); |
519 |
|
ListIterator e2 = ((List) o).listIterator(); |
520 |
< |
while(e1.hasNext() && e2.hasNext()) { |
520 |
> |
while (e1.hasNext() && e2.hasNext()) { |
521 |
|
E o1 = e1.next(); |
522 |
|
Object o2 = e2.next(); |
523 |
|
if (!(o1==null ? o2==null : o1.equals(o2))) |