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