| 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.ShortListIterator; |
| 20 | |
|
| 21 | |
|
| 22 | |
|
| 23 | |
|
| 24 | |
|
| 25 | |
|
| 26 | |
|
| 27 | |
|
| 28 | |
public final class UnmodifiableShortListIterator extends ProxyShortListIterator { |
| 29 | 12 | UnmodifiableShortListIterator(ShortListIterator iterator) { |
| 30 | 12 | this.proxied = iterator; |
| 31 | 12 | } |
| 32 | |
|
| 33 | |
public void remove() { |
| 34 | 6 | throw new UnsupportedOperationException("This ShortListIterator is not modifiable."); |
| 35 | |
} |
| 36 | |
|
| 37 | |
public void add(short value) { |
| 38 | 6 | throw new UnsupportedOperationException("This ShortListIterator is not modifiable."); |
| 39 | |
} |
| 40 | |
|
| 41 | |
public void set(short value) { |
| 42 | 6 | throw new UnsupportedOperationException("This ShortListIterator is not modifiable."); |
| 43 | |
} |
| 44 | |
|
| 45 | |
protected ShortListIterator getListIterator() { |
| 46 | 188 | return proxied; |
| 47 | |
} |
| 48 | |
|
| 49 | |
|
| 50 | |
public static final ShortListIterator wrap(ShortListIterator iterator) { |
| 51 | 15 | if(null == iterator) { |
| 52 | 1 | return null; |
| 53 | 14 | } else if(iterator instanceof UnmodifiableShortListIterator) { |
| 54 | 2 | return iterator; |
| 55 | |
} else { |
| 56 | 12 | return new UnmodifiableShortListIterator(iterator); |
| 57 | |
} |
| 58 | |
} |
| 59 | |
|
| 60 | 12 | private ShortListIterator proxied = null; |
| 61 | |
} |