java.lang.Object
org.apache.lucene.util.automaton.IntSet
org.apache.lucene.util.automaton.StateSet

final class StateSet extends IntSet
A thin wrapper of IntIntHashMap Maps from state in integer representation to its reference count Whenever the count of a state is 0, that state will be removed from the set
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private int[]
     
    private boolean
     
    private long
     
    private boolean
     
    private final IntIntHashMap
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    StateSet(int capacity)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    (package private) void
    decr(int state)
    Decrease the reference count of the state, if the count down to 0, remove the state from this set
    (package private) FrozenIntSet
    freeze(int state)
    Create a snapshot of this int set associated with a given state.
    (package private) int[]
    Return an array representation of this int set's values.
    (package private) void
    incr(int state)
    Add the state into this set, if it is already there, increase its reference count by 1
    private void
     
    (package private) long
     
    (package private) int
    Guaranteed to be less than or equal to the length of the array returned by IntSet.getArray().

    Methods inherited from class org.apache.lucene.util.automaton.IntSet

    equals, hashCode

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • inner

      private final IntIntHashMap inner
    • hashCode

      private long hashCode
    • hashUpdated

      private boolean hashUpdated
    • arrayUpdated

      private boolean arrayUpdated
    • arrayCache

      private int[] arrayCache
  • Constructor Details

    • StateSet

      StateSet(int capacity)
  • Method Details

    • incr

      void incr(int state)
      Add the state into this set, if it is already there, increase its reference count by 1
      Parameters:
      state - an integer representing this state
    • decr

      void decr(int state)
      Decrease the reference count of the state, if the count down to 0, remove the state from this set
      Parameters:
      state - an integer representing this state
    • freeze

      FrozenIntSet freeze(int state)
      Create a snapshot of this int set associated with a given state. The snapshot will not retain any frequency information about the elements of this set, only existence.
      Parameters:
      state - the state to associate with the frozen set.
      Returns:
      A new FrozenIntSet with the same values as this set.
    • keyChanged

      private void keyChanged()
    • getArray

      int[] getArray()
      Description copied from class: IntSet
      Return an array representation of this int set's values. Values are valid for indices [0, IntSet.size()). If this is a mutable int set, then changes to the set are not guaranteed to be visible in this array.
      Specified by:
      getArray in class IntSet
      Returns:
      an array containing the values for this set, guaranteed to be at least IntSet.size() elements
    • size

      int size()
      Description copied from class: IntSet
      Guaranteed to be less than or equal to the length of the array returned by IntSet.getArray().
      Specified by:
      size in class IntSet
      Returns:
      The number of values in this set.
    • longHashCode

      long longHashCode()
      Specified by:
      longHashCode in class IntSet