676 |
|
* in the correct order. |
677 |
|
* |
678 |
|
* @return an array containing all of the elements in this list |
679 |
< |
* in the correct order |
679 |
> |
* in the correct order |
680 |
|
*/ |
681 |
|
public Object[] toArray() { |
682 |
< |
return copyElements(new Object[size()]); |
682 |
> |
return copyElements(new Object[size()]); |
683 |
|
} |
684 |
|
|
685 |
|
/** |
694 |
|
* immediately following the end of the collection is set to <tt>null</tt>. |
695 |
|
* |
696 |
|
* @param a the array into which the elements of the deque are to |
697 |
< |
* be stored, if it is big enough; otherwise, a new array of the |
698 |
< |
* same runtime type is allocated for this purpose |
697 |
> |
* be stored, if it is big enough; otherwise, a new array of the |
698 |
> |
* same runtime type is allocated for this purpose |
699 |
|
* @return an array containing the elements of the deque |
700 |
|
* @throws ArrayStoreException if the runtime type of a is not a supertype |
701 |
|
* of the runtime type of every element in this deque |
705 |
|
if (a.length < size) |
706 |
|
a = (T[])java.lang.reflect.Array.newInstance( |
707 |
|
a.getClass().getComponentType(), size); |
708 |
< |
copyElements(a); |
708 |
> |
copyElements(a); |
709 |
|
if (a.length > size) |
710 |
|
a[size] = null; |
711 |
|
return a; |