1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
|
17 | |
package org.apache.commons.collections.primitives.decorators; |
18 | |
|
19 | |
import org.apache.commons.collections.primitives.DoubleListIterator; |
20 | |
|
21 | |
|
22 | |
|
23 | |
|
24 | |
|
25 | |
|
26 | |
|
27 | |
|
28 | |
public final class UnmodifiableDoubleListIterator extends ProxyDoubleListIterator { |
29 | 12 | UnmodifiableDoubleListIterator(DoubleListIterator iterator) { |
30 | 12 | this.proxied = iterator; |
31 | 12 | } |
32 | |
|
33 | |
public void remove() { |
34 | 6 | throw new UnsupportedOperationException("This DoubleListIterator is not modifiable."); |
35 | |
} |
36 | |
|
37 | |
public void add(double value) { |
38 | 6 | throw new UnsupportedOperationException("This DoubleListIterator is not modifiable."); |
39 | |
} |
40 | |
|
41 | |
public void set(double value) { |
42 | 6 | throw new UnsupportedOperationException("This DoubleListIterator is not modifiable."); |
43 | |
} |
44 | |
|
45 | |
protected DoubleListIterator getListIterator() { |
46 | 188 | return proxied; |
47 | |
} |
48 | |
|
49 | |
|
50 | |
public static final DoubleListIterator wrap(DoubleListIterator iterator) { |
51 | 15 | if(null == iterator) { |
52 | 1 | return null; |
53 | 14 | } else if(iterator instanceof UnmodifiableDoubleListIterator) { |
54 | 2 | return iterator; |
55 | |
} else { |
56 | 12 | return new UnmodifiableDoubleListIterator(iterator); |
57 | |
} |
58 | |
} |
59 | |
|
60 | 12 | private DoubleListIterator proxied = null; |
61 | |
} |