Package jflex
Class CharSet
java.lang.Object
jflex.CharSet
Character set.
- Version:
- JFlex 1.7.0
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) long[]
(package private) static final int
(package private) static final int
private int
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(int character) Add the character to the set.Enumerates all characters.boolean
Returns whether the set contains elements.boolean
isElement
(int character) Returns whether the character belongs to the set.private int
nbits2size
(int nbits) private void
resize
(int nbits) int
size()
Number of characters in the set.toString()
Returns a representation of this set.
-
Field Details
-
BITS
static final int BITS- See Also:
-
MOD
static final int MOD- See Also:
-
bits
long[] bits -
numElements
private int numElements
-
-
Constructor Details
-
CharSet
public CharSet()Constructor for CharSet. -
CharSet
public CharSet(int initialSize, int character) Constructor for CharSet.- Parameters:
initialSize
- inital size.character
- character.
-
-
Method Details
-
add
public void add(int character) Add the character to the set.- Parameters:
character
- character.
-
nbits2size
private int nbits2size(int nbits) -
resize
private void resize(int nbits) -
isElement
public boolean isElement(int character) Returns whether the character belongs to the set.- Parameters:
character
- character.- Returns:
- whether the given character is an element of this set.
-
characters
Enumerates all characters.- Returns:
- a
CharSetEnumerator
over all characters.
-
containsElements
public boolean containsElements()Returns whether the set contains elements.- Returns:
- whether the set is non-empty.
-
size
public int size()Number of characters in the set.- Returns:
- size of the size.
-
toString
Returns a representation of this set.
-