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