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 UnmodifiableDoubleListIterator(DoubleListIterator iterator) {
30 this.proxied = iterator;
31 }
32
33 public void remove() {
34 throw new UnsupportedOperationException("This DoubleListIterator is not modifiable.");
35 }
36
37 public void add(double value) {
38 throw new UnsupportedOperationException("This DoubleListIterator is not modifiable.");
39 }
40
41 public void set(double value) {
42 throw new UnsupportedOperationException("This DoubleListIterator is not modifiable.");
43 }
44
45 protected DoubleListIterator getListIterator() {
46 return proxied;
47 }
48
49
50 public static final DoubleListIterator wrap(DoubleListIterator iterator) {
51 if(null == iterator) {
52 return null;
53 } else if(iterator instanceof UnmodifiableDoubleListIterator) {
54 return iterator;
55 } else {
56 return new UnmodifiableDoubleListIterator(iterator);
57 }
58 }
59
60 private DoubleListIterator proxied = null;
61 }