Class BitSet

  • All Implemented Interfaces:
    Cloneable

    public class BitSet
    extends Object
    implements Cloneable
    A stripped-down version of org.antlr.misc.BitSet that is just good enough to handle runtime requirements such as FOLLOW sets for automatic error recovery.
    • Constructor Detail

      • BitSet

        public BitSet()
        Construct a bitset of size one word (64 bits)
      • BitSet

        public BitSet​(long[] bits_)
        Construction from a static array of longs
      • BitSet

        public BitSet​(List<Integer> items)
        Construction from a list of integers
      • BitSet

        public BitSet​(int nbits)
        Construct a bitset given the size
        Parameters:
        nbits - The size of the bitset in bits
    • Method Detail

      • of

        public static BitSet of​(int el)
      • of

        public static BitSet of​(int a,
                                int b)
      • of

        public static BitSet of​(int a,
                                int b,
                                int c)
      • of

        public static BitSet of​(int a,
                                int b,
                                int c,
                                int d)
      • or

        public BitSet or​(BitSet a)
        return this | a in a new set
      • add

        public void add​(int el)
        or this element into this set (grow as necessary to accommodate)
      • growToInclude

        public void growToInclude​(int bit)
        Grows the set to a larger number of bits.
        Parameters:
        bit - element that must fit in set
      • orInPlace

        public void orInPlace​(BitSet a)
      • size

        public int size()
      • member

        public boolean member​(int el)
      • remove

        public void remove​(int el)
      • isNil

        public boolean isNil()
      • numBits

        public int numBits()
      • lengthInLongWords

        public int lengthInLongWords()
        return how much space is being used by the bits array not how many actually have member bits on.
      • toArray

        public int[] toArray()
        Is this contained within a?
      • toPackedArray

        public long[] toPackedArray()
      • toString

        public String toString​(String[] tokenNames)