Modifier and Type | Field and Description |
---|---|
protected long[] |
bits
The actual data bits
|
protected static int |
BITS |
protected static int |
LOG_BITS |
protected static int |
MOD_MASK |
Constructor and Description |
---|
BitSet()
Construct a bitset of size one word (64 bits)
|
BitSet(int nbits)
Construct a bitset given the size
|
BitSet(List<Integer> items)
Construction from a list of integers
|
BitSet(long[] bits_)
Construction from a static array of longs
|
Modifier and Type | Method and Description |
---|---|
void |
add(int el)
or this element into this set (grow as necessary to accommodate)
|
Object |
clone() |
boolean |
equals(Object other) |
void |
growToInclude(int bit)
Grows the set to a larger number of bits.
|
boolean |
isNil() |
int |
lengthInLongWords()
return how much space is being used by the bits array not
how many actually have member bits on.
|
boolean |
member(int el) |
int |
numBits() |
static BitSet |
of(int el) |
static BitSet |
of(int a,
int b) |
static BitSet |
of(int a,
int b,
int c) |
static BitSet |
of(int a,
int b,
int c,
int d) |
BitSet |
or(BitSet a)
return this | a in a new set
|
void |
orInPlace(BitSet a) |
void |
remove(int el) |
int |
size() |
int[] |
toArray()
Is this contained within a?
|
long[] |
toPackedArray() |
String |
toString() |
String |
toString(String[] tokenNames) |
protected static final int BITS
protected static final int LOG_BITS
protected static final int MOD_MASK
protected long[] bits
public BitSet()
public BitSet(long[] bits_)
public BitSet(int nbits)
nbits
- The size of the bitset in bitspublic static BitSet of(int el)
public static BitSet of(int a, int b)
public static BitSet of(int a, int b, int c)
public static BitSet of(int a, int b, int c, int d)
public void add(int el)
public void growToInclude(int bit)
bit
- element that must fit in setpublic void orInPlace(BitSet a)
public int size()
public boolean member(int el)
public void remove(int el)
public boolean isNil()
public int numBits()
public int lengthInLongWords()
public int[] toArray()
public long[] toPackedArray()
Copyright © 1992–2015 ANTLR. All rights reserved.