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 boolean
private long
private boolean
private final IntIntHashMap
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(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[]
getArray()
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 1private void
(package private) long
(package private) void
reset()
(package private) int
size()
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
-
reset
void reset() -
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: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 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:IntSet
Guaranteed to be less than or equal to the length of the array returned byIntSet.getArray()
. -
longHashCode
long longHashCode()- Specified by:
longHashCode
in classIntSet
-