Class Tokenizer

    • Method Detail

      • close

        public void close()
                   throws java.io.IOException
        Releases resources associated with this stream.

        If you override this method, always call super.close(), otherwise some internal state will not be correctly reset (e.g., Tokenizer will throw IllegalStateException on reuse).

        NOTE: The default implementation closes the input Reader, so be sure to call super.close() when overriding this method.

        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Overrides:
        close in class TokenStream
        Throws:
        java.io.IOException
      • setReader

        public final void setReader​(java.io.Reader input)
                             throws java.io.IOException
        Expert: Set a new reader on the Tokenizer. Typically, an analyzer (in its tokenStream method) will use this to re-use a previously created tokenizer.
        Throws:
        java.io.IOException
      • reset

        public void reset()
                   throws java.io.IOException
        Description copied from class: TokenStream
        This method is called by a consumer before it begins consumption using TokenStream.incrementToken().

        Resets this stream to a clean state. Stateful implementations must implement this method so that they can be reused, just as if they had been created fresh.

        If you override this method, always call super.reset(), otherwise some internal state will not be correctly reset (e.g., Tokenizer will throw IllegalStateException on further usage).

        Overrides:
        reset in class TokenStream
        Throws:
        java.io.IOException