1 17 18 19 20 package org.apache.fop.fo; 21 22 import java.util.NoSuchElementException ; 23 24 27 public class OneCharIterator extends CharIterator { 28 29 private boolean bFirst = true; 30 private char charCode; 31 32 36 public OneCharIterator(char c) { 37 this.charCode = c; 38 } 39 40 45 public boolean hasNext() { 46 return bFirst; 47 } 48 49 54 public char nextChar() throws NoSuchElementException { 55 if (bFirst) { 56 bFirst = false; 57 return charCode; 58 } else { 59 throw new NoSuchElementException (); 60 } 61 } 62 63 } 64 65 | Popular Tags |