1 17 package org.apache.commons.collections.primitives.decorators; 18 19 import org.apache.commons.collections.primitives.DoubleIterator; 20 21 28 public final class UnmodifiableDoubleIterator extends ProxyDoubleIterator { 29 UnmodifiableDoubleIterator(DoubleIterator iterator) { 30 this.proxied = iterator; 31 } 32 33 public void remove() { 34 throw new UnsupportedOperationException ("This DoubleIterator is not modifiable."); 35 } 36 37 protected DoubleIterator getIterator() { 38 return proxied; 39 } 40 41 public static final DoubleIterator wrap(DoubleIterator iterator) { 42 if(null == iterator) { 43 return null; 44 } else if(iterator instanceof UnmodifiableDoubleIterator) { 45 return iterator; 46 } else { 47 return new UnmodifiableDoubleIterator(iterator); 48 } 49 } 50 51 private DoubleIterator proxied = null; 52 } 53 | Popular Tags |