244 |
|
} |
245 |
|
|
246 |
|
/** |
247 |
– |
* Returns the array index of the last element. |
248 |
– |
* May return invalid index -1 if there are no elements. |
249 |
– |
*/ |
250 |
– |
final int last() { |
251 |
– |
return dec(tail, elements.length); |
252 |
– |
} |
253 |
– |
|
254 |
– |
/** |
247 |
|
* Returns element at array index i. |
248 |
|
* This is a slight abuse of generics, accepted by javac. |
249 |
|
*/ |
744 |
|
} |
745 |
|
|
746 |
|
private class DescendingIterator extends DeqIterator { |
747 |
< |
DescendingIterator() { cursor = last(); } |
747 |
> |
DescendingIterator() { cursor = dec(tail, elements.length); } |
748 |
|
|
749 |
|
public final E next() { |
750 |
|
if (remaining <= 0) |