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