Note
JBitSet was driven by the (current and perceived) needs of the optimizer, but placed in the util package since it is not specific to query trees..
Note
java.util.BitSet is final, so we must provide a wrapper class which includes a BitSet member in order to extend the functionality. We want to make it look like JBitSet extends BitSet, so we need to provide wrapper methods for all of BitSet's methods.
| Access | Constructor and Description |
|---|---|
| public | |
| private |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public void | |
| public void | |
| public Object | |
| public boolean | |
| public boolean | equals(Object
the reference object with which to compare. obj)Overrides java. Indicates whether some other object is "equal to" this one. |
| public boolean | |
| public int | Returns: int Index of first set bit, -1 if none set.Get the first set bit (starting at index 0) from a JBitSet. |
| public void | |
| public int | |
| public boolean | Returns: boolean Whether or not JBitSet has a single bit set.See of a JBitSet has exactly 1 bit set. |
| public void | |
| public void | |
| public void | |
| public int | |
| public String | |
| public void |
| JBitSet | back to summary |
|---|---|
| public JBitSet(int size) Construct a JBitSet of the specified size.
| |
| JBitSet | back to summary |
|---|---|
| private JBitSet(BitSet bitSet, int size) Construct a JBitSet with the specified bitSet.
| |
| and | back to summary |
|---|---|
| public void and(JBitSet set) | |
| clear | back to summary |
|---|---|
| public void clear(int bitIndex) | |
| clearAll | back to summary |
|---|---|
| public void clearAll() Clear all of the bits in this JBitSet | |
| clone | back to summary |
|---|---|
| public Object clone() Overrides java. Doc from java. Creates and returns a copy of this object. The precise meaning
of "copy" may depend on the class of the object. The general
intent is that, for any object will be true, and that the expression:x.clone() != x will bex.clone().getClass() == x.getClass() true, but these are not absolute requirements.
While it is typically the case that:
will bex.clone().equals(x) true, this is not an absolute requirement.
By convention, the returned object should be obtained by calling
By convention, the object returned by this method should be independent
of this object (which is being cloned). To achieve this independence,
it may be necessary to modify one or more fields of the object returned
by
| |
| contains | back to summary |
|---|---|
| public boolean contains(JBitSet jBitSet) Test to see if one JBitSet contains another one of the same size.
| |
| equals | back to summary |
|---|---|
| public boolean equals(Object obj) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.
| |
| get | back to summary |
|---|---|
| public boolean get(int bitIndex) | |
| getFirstSetBit | back to summary |
|---|---|
| public int getFirstSetBit() Get the first set bit (starting at index 0) from a JBitSet.
| |
| grow | back to summary |
|---|---|
| public void grow(int newSize) Grow an existing JBitSet to the specified size.
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for this object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| hasSingleBitSet | back to summary |
|---|---|
| public boolean hasSingleBitSet() See of a JBitSet has exactly 1 bit set.
| |
| or | back to summary |
|---|---|
| public void or(JBitSet set) | |
| set | back to summary |
|---|---|
| public void set(int bitIndex) | |
| setTo | back to summary |
|---|---|
| public void setTo(JBitSet sourceBitSet) Set the BitSet to have the exact same bits set as the parameter's BitSet.
| |
| size | back to summary |
|---|---|
| public int size() Return the size of bitSet
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non-
| |
| xor | back to summary |
|---|---|
| public void xor(JBitSet set) | |