Class TokenEnum


  • public final class TokenEnum
    extends java.lang.Object
    Enumeration for scanning token lists efficiently

    Expert Use Only.

    • Constructor Summary

      Constructors 
      Modifier Constructor Description
        TokenEnum()
      Initialize an unpositioned TokenEnum.
      protected TokenEnum​(com.attivio.sdk.token.TokenList.Element head)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int endOffset()
      Get the end offset for the current position.
      int endOffset​(int span)
      Get the end offset for the current position of span length.
      int increment()
      Get the position increment for the current token.
      Token next()
      Advance to the next element.
      Token reset​(TokenList tokens)
      Position this TokenEnum at the beginning of tokens.
      Token seek​(TokenEnum other)
      Position this TokenEnum at the same location as other.
      int startOffset()
      Get the start offset for the current position.
      Token token()
      Get the current token.
      • Methods inherited from class java.lang.Object

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

      • TokenEnum

        public TokenEnum()
        Initialize an unpositioned TokenEnum.
      • TokenEnum

        protected TokenEnum​(com.attivio.sdk.token.TokenList.Element head)
    • Method Detail

      • token

        public Token token()
        Get the current token.
      • increment

        public int increment()
        Get the position increment for the current token.
      • startOffset

        public int startOffset()
        Get the start offset for the current position.
      • endOffset

        public int endOffset()
        Get the end offset for the current position.
      • endOffset

        public int endOffset​(int span)
        Get the end offset for the current position of span length.
      • reset

        public Token reset​(TokenList tokens)
        Position this TokenEnum at the beginning of tokens.

        Returns null if tokens has no indexed tokens.

      • seek

        public Token seek​(TokenEnum other)
        Position this TokenEnum at the same location as other.
      • next

        public Token next()
        Advance to the next element.

        Returns null if there are no more elements.