antlr.collections.impl
public class BitSet extends Object implements Cloneable
Field Summary | |
---|---|
protected long[] | bits The actual data bits |
protected static int | BITS |
protected static int | LOG_BITS |
protected static int | MOD_MASK |
protected static int | NIBBLE |
Constructor Summary | |
---|---|
BitSet() Construct a bitset of size one word (64 bits) | |
BitSet(long[] bits_) Construction from a static array of longs | |
BitSet(int nbits) Construct a bitset given the size |
Method Summary | |
---|---|
void | add(int el) or this element into this set (grow as necessary to accommodate) |
BitSet | and(BitSet a) |
void | andInPlace(BitSet a) |
void | clear() |
void | clear(int el) |
Object | clone() |
int | degree() |
boolean | equals(Object obj) code "inherited" from java.util.BitSet |
static Vector | getRanges(int[] elems) Find ranges in a set element array. |
void | growToInclude(int bit)
Grows the set to a larger number of bits. |
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) |
boolean | nil() |
BitSet | not() |
void | notInPlace() |
void | notInPlace(int maxBit) complement bits in the range 0..maxBit. |
void | notInPlace(int minBit, int maxBit) complement bits in the range minBit..maxBit. |
static BitSet | of(int el) |
BitSet | or(BitSet a) return this | a in a new set |
void | orInPlace(BitSet a) |
void | remove(int el) |
int | size() |
boolean | subset(BitSet a) Is this contained within a? |
void | subtractInPlace(BitSet a) Subtract the elements of 'a' from 'this' in-place.
|
int[] | toArray() |
long[] | toPackedArray() |
String | toString() |
String | toString(String separator) Transform a bit set into a string by formatting each element as an integer |
String | toString(String separator, CharFormatter formatter) Transform a bit set into a string of characters. |
String | toString(String separator, Vector vocabulary) Create a string representation where instead of integer elements, the
ith element of vocabulary is displayed instead. |
String | toStringOfHalfWords()
Dump a comma-separated list of the words making up the bit set.
|
String | toStringOfWords()
Dump a comma-separated list of the words making up the bit set.
|
String | toStringWithRanges(String separator, CharFormatter formatter) Print out the bit set but collapse char ranges. |
Parameters: nbits The size of the bitset in bits
Returns: Vector of ranges.
Parameters: bit element that must fit in set
Returns: A commma-separated list of values
UNKNOWN: The string to put in between elements
Parameters: formatter An object implementing the CharFormatter interface.
Returns: A commma-separated list of character constants.
UNKNOWN: The string to put in between elements
Returns: A commma-separated list of character constants.
UNKNOWN: The string to put in between elements