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