1 17 package org.apache.commons.collections.primitives.adapters; 18 19 import java.util.Iterator ; 20 21 import org.apache.commons.collections.primitives.BooleanIterator; 22 23 34 public class IteratorBooleanIterator implements BooleanIterator { 35 36 49 public static BooleanIterator wrap(Iterator iterator) { 50 return null == iterator ? null : new IteratorBooleanIterator(iterator); 51 } 52 53 58 public IteratorBooleanIterator(Iterator iterator) { 59 _iterator = iterator; 60 } 61 62 public boolean hasNext() { 63 return _iterator.hasNext(); 64 } 65 66 public boolean next() { 67 return ((Boolean )(_iterator.next())).booleanValue(); 68 } 69 70 public void remove() { 71 _iterator.remove(); 72 } 73 74 private Iterator _iterator = null; 75 76 } 77 | Popular Tags |