157 |
|
|
158 |
|
/** |
159 |
|
* Adds the specified element to the tail of this queue. |
160 |
< |
* @param o the element to add. |
160 |
> |
* @param e the element to add. |
161 |
|
* @return <tt>true</tt> (as per the general contract of |
162 |
|
* <tt>Collection.add</tt>). |
163 |
|
* |
164 |
|
* @throws NullPointerException if the specified element is <tt>null</tt>. |
165 |
|
*/ |
166 |
< |
public boolean add(E o) { |
167 |
< |
return offer(o); |
166 |
> |
public boolean add(E e) { |
167 |
> |
return offer(e); |
168 |
|
} |
169 |
|
|
170 |
|
/** |
171 |
|
* Inserts the specified element to the tail of this queue. |
172 |
|
* |
173 |
< |
* @param o the element to add. |
173 |
> |
* @param e the element to add. |
174 |
|
* @return <tt>true</tt> (as per the general contract of |
175 |
|
* <tt>Queue.offer</tt>). |
176 |
|
* @throws NullPointerException if the specified element is <tt>null</tt>. |
177 |
|
*/ |
178 |
< |
public boolean offer(E o) { |
179 |
< |
if (o == null) throw new NullPointerException(); |
180 |
< |
Node<E> n = new Node<E>(o, null); |
178 |
> |
public boolean offer(E e) { |
179 |
> |
if (e == null) throw new NullPointerException(); |
180 |
> |
Node<E> n = new Node<E>(e, null); |
181 |
|
for(;;) { |
182 |
|
Node<E> t = tail; |
183 |
|
Node<E> s = t.getNext(); |