Class ScopeInfo

  • All Implemented Interfaces:
    java.util.Iterator<Token>

    public final class ScopeInfo
    extends java.lang.Object
    implements java.util.Iterator<Token>
    Represents scope tokens.

    ADVANCED: this structure represents advanced scope identification information and may change in incompatible ways in the future.

    NOTE: this class implements the Iterator interface to support iterating over scope tokens efficiently. Iteration can be reset at any time by calling resetIteration().

    • Constructor Summary

      Constructors 
      Modifier Constructor Description
        ScopeInfo()
      Create a new ScopeInfo instance (for reuse).
      protected ScopeInfo​(com.attivio.sdk.token.TokenList.Element head, com.attivio.sdk.token.TokenList.Element tail)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int endScopeCount()  
      int getPositionIncrement()
      Get the position increment for the last Token returned by next().
      boolean hasNext()  
      boolean isPhraseBreak​(java.lang.String... scopes)
      Returns true if a phrase break occurs.
      boolean isScopeEnd​(java.lang.String scope)
      Check if this ScopeInfo represents the end of scope.
      boolean isScopeStart​(java.lang.String scope)
      Check if this ScopeInfo represents the start of scope.
      Token next()  
      void remove()
      Not Supported
      ScopeInfo resetIteration()
      Reset iteration.
      protected static ScopeInfo reuse​(ScopeInfo reuse, com.attivio.sdk.token.TokenList.Element head, com.attivio.sdk.token.TokenList.Element tail)
      Get a scope info, reusing if possible.
      int startScopeCount()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.util.Iterator

        forEachRemaining
    • Constructor Detail

      • ScopeInfo

        public ScopeInfo()
        Create a new ScopeInfo instance (for reuse).
      • ScopeInfo

        protected ScopeInfo​(com.attivio.sdk.token.TokenList.Element head,
                            com.attivio.sdk.token.TokenList.Element tail)
    • Method Detail

      • reuse

        protected static ScopeInfo reuse​(ScopeInfo reuse,
                                         com.attivio.sdk.token.TokenList.Element head,
                                         com.attivio.sdk.token.TokenList.Element tail)
        Get a scope info, reusing if possible.
      • resetIteration

        public ScopeInfo resetIteration()
        Reset iteration.
      • hasNext

        public boolean hasNext()
        Specified by:
        hasNext in interface java.util.Iterator<Token>
      • next

        public Token next()
        Specified by:
        next in interface java.util.Iterator<Token>
      • getPositionIncrement

        public int getPositionIncrement()
        Get the position increment for the last Token returned by next().
      • remove

        public void remove()
        Not Supported
        Specified by:
        remove in interface java.util.Iterator<Token>
      • isPhraseBreak

        public boolean isPhraseBreak​(java.lang.String... scopes)
        Returns true if a phrase break occurs.

        Phrase breaks include:

        • any scope specified in scopes starting or ending.
        • any scope that has a position increment > 1.
      • startScopeCount

        public int startScopeCount()
      • endScopeCount

        public int endScopeCount()
      • isScopeStart

        public boolean isScopeStart​(java.lang.String scope)
        Check if this ScopeInfo represents the start of scope.
      • isScopeEnd

        public boolean isScopeEnd​(java.lang.String scope)
        Check if this ScopeInfo represents the end of scope.