java.lang.Object
org.apache.tika.parser.microsoft.rtf.jflex.RTFToken

public class RTFToken extends Object
A single token produced by the RTF tokenizer.

Mutable and reused by the tokenizer to avoid allocation in the hot loop. Consumers must copy any data they need before requesting the next token.

For TEXT and CONTROL_SYMBOL tokens (single character), use getChar() to avoid String allocation. For CONTROL_WORD tokens, use getName().

  • Constructor Details

    • RTFToken

      public RTFToken()
  • Method Details

    • reset

      public void reset(RTFTokenType type)
    • set

      public void set(RTFTokenType type, String name, int parameter, boolean hasParameter)
    • setChar

      public void setChar(RTFTokenType type, char ch)
    • getType

      public RTFTokenType getType()
    • getName

      public String getName()
      For CONTROL_WORD tokens: the control word name.
    • getChar

      public char getChar()
      For TEXT and CONTROL_SYMBOL tokens: the single character, without allocating a String.
    • getParameter

      public int getParameter()
    • hasParameter

      public boolean hasParameter()
    • getHexValue

      public int getHexValue()
    • toString

      public String toString()
      Overrides:
      toString in class Object