Package jflex

Class 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  
    • Constructor Summary

      Constructors 
      Constructor Description
      CharSet()
      Constructor for CharSet.
      CharSet​(int initialSize, int character)
      Constructor for CharSet.
    • 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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • CharSet

        public CharSet()
        Constructor for CharSet.
      • CharSet

        public CharSet​(int initialSize,
                       int character)
        Constructor for CharSet.
        Parameters:
        initialSize - inital size.
        character - character.
    • 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.
      • 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 class java.lang.Object
        Returns:
        a String representation of this set.