2 |
|
* Written by Doug Lea with assistance from members of JCP JSR-166 |
3 |
|
* Expert Group and released to the public domain, as explained at |
4 |
|
* http://creativecommons.org/licenses/publicdomain |
5 |
< |
* Other contributors include Andrew Wright, Jeffrey Hayes, |
6 |
< |
* Pat Fisher, Mike Judd. |
5 |
> |
* Other contributors include Andrew Wright, Jeffrey Hayes, |
6 |
> |
* Pat Fisher, Mike Judd. |
7 |
|
*/ |
8 |
|
|
9 |
|
|
22 |
|
} |
23 |
|
|
24 |
|
static class Succeed extends AbstractQueue<Integer> { |
25 |
< |
public boolean offer(Integer x) { |
25 |
> |
public boolean offer(Integer x) { |
26 |
|
if (x == null) throw new NullPointerException(); |
27 |
< |
return true; |
27 |
> |
return true; |
28 |
|
} |
29 |
|
public Integer peek() { return one; } |
30 |
|
public Integer poll() { return one; } |
33 |
|
} |
34 |
|
|
35 |
|
static class Fail extends AbstractQueue<Integer> { |
36 |
< |
public boolean offer(Integer x) { |
36 |
> |
public boolean offer(Integer x) { |
37 |
|
if (x == null) throw new NullPointerException(); |
38 |
< |
return false; |
38 |
> |
return false; |
39 |
|
} |
40 |
|
public Integer peek() { return null; } |
41 |
|
public Integer poll() { return null; } |