You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

AbstractCharIterator.java 1.7KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /*
  2. * Copyright 1999-2004 The Apache Software Foundation.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. /* $Id$ */
  17. package org.apache.fop.fo;
  18. import java.util.NoSuchElementException;
  19. /**
  20. * Abstract base class for character iterators.
  21. */
  22. public abstract class AbstractCharIterator implements CharIterator, Cloneable {
  23. /**
  24. * @see java.util.Iterator#hasNext()
  25. */
  26. public abstract boolean hasNext();
  27. /**
  28. * @see org.apache.fop.fo.CharIterator#nextChar()
  29. */
  30. public abstract char nextChar() throws NoSuchElementException ;
  31. /**
  32. * @see java.util.Iterator#next()
  33. */
  34. public Object next() throws NoSuchElementException {
  35. return new Character(nextChar());
  36. }
  37. /**
  38. * @see java.util.Iterator#remove()
  39. */
  40. public void remove() {
  41. throw new UnsupportedOperationException();
  42. }
  43. /**
  44. * @see org.apache.fop.fo.CharIterator#replaceChar(char)
  45. */
  46. public void replaceChar(char c) {
  47. }
  48. /**
  49. * @see java.lang.Object#clone()
  50. */
  51. public Object clone() {
  52. try {
  53. return super.clone();
  54. } catch (CloneNotSupportedException ex) {
  55. return null;
  56. }
  57. }
  58. }