KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > fop > fo > CharIterator


1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one or more
3  * contributor license agreements. See the NOTICE file distributed with
4  * this work for additional information regarding copyright ownership.
5  * The ASF licenses this file to You under the Apache License, Version 2.0
6  * (the "License"); you may not use this file except in compliance with
7  * the License. You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */

17
18 /* $Id: CharIterator.java 426576 2006-07-28 15:44:37Z jeremias $ */
19  
20 package org.apache.fop.fo;
21
22 import java.util.Iterator JavaDoc;
23 import java.util.NoSuchElementException JavaDoc;
24
25 /**
26  * Abstract base class for iterators that should iterate through a series
27  * of characters. Extends the java.util.Iterator interface with some
28  * additional functions useful for FOP's management of text.
29  */

30 public abstract class CharIterator implements Iterator JavaDoc, Cloneable JavaDoc {
31
32     /**
33      * @see java.util.Iterator#hasNext()
34      */

35     public abstract boolean hasNext();
36
37     /**
38      * @return the character that is the next character in the collection
39      * @throws NoSuchElementException if there are no more characters (test for
40      * this condition with java.util.Iterator.hasNext()).
41      */

42     public abstract char nextChar() throws NoSuchElementException JavaDoc;
43
44     /**
45      * @see java.util.Iterator#next()
46      */

47     public Object JavaDoc next() throws NoSuchElementException JavaDoc {
48         return new Character JavaDoc(nextChar());
49     }
50
51     /**
52      * @see java.util.Iterator#remove()
53      */

54     public void remove() {
55         throw new UnsupportedOperationException JavaDoc();
56     }
57
58
59     /**
60      * Replace the current character managed by the iterator with a specified
61      * character?
62      * @param c character
63      */

64     public void replaceChar(char c) {
65     }
66
67     /**
68      * @see java.lang.Object#clone()
69      */

70     public Object JavaDoc clone() {
71         try {
72             return super.clone();
73         } catch (CloneNotSupportedException JavaDoc ex) {
74             return null;
75         }
76     }
77 }
78
79
Popular Tags