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 35 public class DoubleIteratorIterator implements Iterator { 36 37 49 public static Iterator wrap(DoubleIterator iterator) { 50 return null == iterator ? null : new DoubleIteratorIterator(iterator); 51 } 52 53 58 public DoubleIteratorIterator(DoubleIterator iterator) { 59 _iterator = iterator; 60 } 61 62 public boolean hasNext() { 63 return _iterator.hasNext(); 64 } 65 66 public Object next() { 67 return new Double (_iterator.next()); 68 } 69 70 public void remove() { 71 _iterator.remove(); 72 } 73 74 private DoubleIterator _iterator = null; 75 76 } 77 | Popular Tags |