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