1 17 package org.apache.commons.collections.primitives.adapters; 18 19 import java.util.Iterator ; 20 21 import org.apache.commons.collections.primitives.IntIterator; 22 23 37 public class IteratorIntIterator implements IntIterator { 38 39 51 public static IntIterator wrap(Iterator iterator) { 52 return null == iterator ? null : new IteratorIntIterator(iterator); 53 } 54 55 60 public IteratorIntIterator(Iterator iterator) { 61 _iterator = iterator; 62 } 63 64 public boolean hasNext() { 65 return _iterator.hasNext(); 66 } 67 68 public int next() { 69 return ((Number )(_iterator.next())).intValue(); 70 } 71 72 public void remove() { 73 _iterator.remove(); 74 } 75 76 private Iterator _iterator = null; 77 78 } 79 | Popular Tags |