java.lang.Object
org.apache.lucene.util.automaton.IntSet
org.apache.lucene.util.automaton.StateSet
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
FieldsModifier and TypeFieldDescriptionprivate int[]private booleanprivate longprivate booleanprivate final IntIntHashMap -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) voiddecr(int state) Decrease the reference count of the state, if the count down to 0, remove the state from this set(package private) FrozenIntSetfreeze(int state) Create a snapshot of this int set associated with a given state.(package private) int[]getArray()Return an array representation of this int set's values.(package private) voidincr(int state) Add the state into this set, if it is already there, increase its reference count by 1private void(package private) long(package private) intsize()Guaranteed to be less than or equal to the length of the array returned byIntSet.getArray().
-
Field Details
-
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
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:IntSetReturn 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:
getArrayin classIntSet- Returns:
- an array containing the values for this set, guaranteed to be at least
IntSet.size()elements
-
size
int size()Description copied from class:IntSetGuaranteed to be less than or equal to the length of the array returned byIntSet.getArray(). -
longHashCode
long longHashCode()- Specified by:
longHashCodein classIntSet
-