Class SingleCharacterReceiver

  • Direct Known Subclasses:
    TagParseState

    public abstract class SingleCharacterReceiver
    extends CharacterReceiver
    This interface represents a receiver for a sequence of individual characters.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected char[] charBuffer  
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      abstract boolean dealWithCharacter​(char c)
      Receive a byte.
      boolean dealWithCharacters​(java.io.Reader reader)
      Receive a stream of characters.
      protected boolean dealWithRemainder​(char[] buffer, int offset, int len, java.io.Reader reader)
      Deal with the remainder of the input.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • charBuffer

        protected final char[] charBuffer
    • Constructor Detail

      • SingleCharacterReceiver

        public SingleCharacterReceiver​(int chunkSize)
        Constructor.
    • Method Detail

      • dealWithCharacter

        public abstract boolean dealWithCharacter​(char c)
                                           throws java.io.IOException,
                                                  ManifoldCFException
        Receive a byte.
        Returns:
        true if done.
        Throws:
        java.io.IOException
        ManifoldCFException
      • dealWithRemainder

        protected boolean dealWithRemainder​(char[] buffer,
                                            int offset,
                                            int len,
                                            java.io.Reader reader)
                                     throws java.io.IOException,
                                            ManifoldCFException
        Deal with the remainder of the input. This is called only when dealWithCharacter() returns true.
        Parameters:
        buffer - is the buffer of characters that should come first.
        offset - is the offset within the buffer of the first character.
        len - is the number of characters in the buffer.
        Returns:
        true to abort, false if the end of the stream has been reached.
        Throws:
        java.io.IOException
        ManifoldCFException