Package com.yahoo.fsa

Class FSA.State

  • Enclosing class:
    FSA

    public static class FSA.State
    extends java.lang.Object
    Thread local state object used to traverse a Finite-State Automaton.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.nio.ByteBuffer data()  
      java.lang.String dataString()  
      void delta​(byte symbol)  
      void delta​(char chr)  
      void delta​(java.lang.String string)
      Jumps ahead by string
      void deltaWord​(java.lang.String string)
      Jumps ahead by a word - if this is not the first word, it must be preceeded by space.
      int hash()  
      boolean hasPerfectHash()  
      boolean isFinal()  
      boolean isStartState()  
      boolean isValid()  
      java.nio.ByteBuffer lookup​(java.lang.String str)  
      boolean peekDelta​(byte symbol)
      Returns whether the given symbol would take us to a valid state, without changing the state
      void start()  
      boolean tryDelta​(byte symbol)  
      boolean tryDelta​(java.lang.String string)
      Jumps ahead by string if that puts us into a valid state, does nothing otherwise
      boolean tryDeltaWord​(java.lang.String string)
      Tries to jump ahead by one word.
      • Methods inherited from class java.lang.Object

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

      • start

        public void start()
      • delta

        public void delta​(byte symbol)
      • peekDelta

        public boolean peekDelta​(byte symbol)
        Returns whether the given symbol would take us to a valid state, without changing the state
      • tryDelta

        public boolean tryDelta​(byte symbol)
      • delta

        public void delta​(char chr)
      • delta

        public void delta​(java.lang.String string)
        Jumps ahead by string
      • tryDelta

        public boolean tryDelta​(java.lang.String string)
        Jumps ahead by string if that puts us into a valid state, does nothing otherwise
        Returns:
        whether we jumped to a valid state (true) or di nothing (false)
      • deltaWord

        public void deltaWord​(java.lang.String string)
        Jumps ahead by a word - if this is not the first word, it must be preceeded by space.
      • tryDeltaWord

        public boolean tryDeltaWord​(java.lang.String string)
        Tries to jump ahead by one word. If the given string is not the next complete valid word, nothing is done.
      • isFinal

        public boolean isFinal()
      • isStartState

        public boolean isStartState()
      • isValid

        public boolean isValid()
      • data

        public java.nio.ByteBuffer data()
      • dataString

        public java.lang.String dataString()
      • hash

        public int hash()
      • lookup

        public java.nio.ByteBuffer lookup​(java.lang.String str)
      • hasPerfectHash

        public boolean hasPerfectHash()