Package jflex
Class CharSet
- java.lang.Object
-
- jflex.CharSet
-
public final class CharSet extends java.lang.ObjectCharacter set.- Version:
- JFlex 1.7.0
-
-
Field Summary
Fields Modifier and Type Field Description (package private) long[]bits(package private) static intBITS(package private) static intMODprivate intnumElements
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(int character)Add the character to the set.CharSetEnumeratorcharacters()Enumerates all characters.booleancontainsElements()Returns whether the set contains elements.booleanisElement(int character)Returns whether the character belongs to the set.private intnbits2size(int nbits)private voidresize(int nbits)intsize()Number of characters in the set.java.lang.StringtoString()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
CharSetEnumeratorover 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:
toStringin classjava.lang.Object- Returns:
- a
Stringrepresentation of this set.
-
-