Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

CharIterator.java 2.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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. /* $Id$ */
  18. package org.apache.fop.fo;
  19. import java.util.Iterator;
  20. import java.util.NoSuchElementException;
  21. /**
  22. * Abstract base class for iterators that should iterate through a series
  23. * of characters. Extends the java.util.Iterator interface with some
  24. * additional functions useful for FOP's management of text.
  25. */
  26. public abstract class CharIterator implements Iterator, Cloneable {
  27. /**
  28. * {@inheritDoc}
  29. */
  30. public abstract boolean hasNext();
  31. /**
  32. * @return the character that is the next character in the collection
  33. * @throws NoSuchElementException if there are no more characters (test for
  34. * this condition with java.util.Iterator.hasNext()).
  35. */
  36. public abstract char nextChar() throws NoSuchElementException;
  37. /**
  38. * {@inheritDoc}
  39. */
  40. public Object next() throws NoSuchElementException {
  41. return nextChar();
  42. }
  43. /**
  44. * {@inheritDoc}
  45. */
  46. public void remove() {
  47. throw new UnsupportedOperationException();
  48. }
  49. /**
  50. * Replace the current character managed by the iterator with a specified
  51. * character?
  52. * @param c character
  53. */
  54. public void replaceChar(char c) {
  55. }
  56. /**
  57. * {@inheritDoc}
  58. */
  59. public Object clone() {
  60. try {
  61. return super.clone();
  62. } catch (CloneNotSupportedException ex) {
  63. return null;
  64. }
  65. }
  66. }