Package jflex
Class CharSet
- java.lang.Object
-
- jflex.CharSet
-
public final class CharSet extends java.lang.Object
Character set.- Version:
- JFlex 1.7.0
-
-
Field Summary
Fields Modifier and Type Field Description (package private) long[]
bits
(package private) static int
BITS
(package private) static int
MOD
private int
numElements
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(int character)
Add the character to the set.CharSetEnumerator
characters()
Enumerates all characters.boolean
containsElements()
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.java.lang.String
toString()
Returns a representation of this set.
-
-
-
Field Detail
-
BITS
static final int BITS
- See Also:
- Constant Field Values
-
MOD
static final int MOD
- See Also:
- Constant Field Values
-
bits
long[] bits
-
numElements
private int numElements
-
-
Method Detail
-
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
public CharSetEnumerator 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
public java.lang.String toString()
Returns a representation of this set.- Overrides:
toString
in classjava.lang.Object
- Returns:
- a
String
representation of this set.
-
-