Package org.apache.calcite.util
Class ImmutableBitSet.Builder
java.lang.Object
org.apache.calcite.util.ImmutableBitSet.Builder
- Enclosing class:
ImmutableBitSet
Builder.
-
Method Summary
Modifier and TypeMethodDescriptionSets all bits in a given list of bits.addAll
(ImmutableBitSet bitSet) Sets all bits in a given bit set.addAll
(ImmutableIntList integers) Sets all bits in a given list ofint
s.build()
Builds an ImmutableBitSet from the contents of this Builder.build
(ImmutableBitSet bitSet) Builds an ImmutableBitSet from the contents of this Builder, using an existing ImmutableBitSet if it happens to have the same contents.Builds an ImmutableBitSet from the contents of this Builder.int
Returns the number of set bits.clear
(int bit) combine
(ImmutableBitSet.Builder builder) Merges another builder.boolean
get
(int bitIndex) void
intersect
(ImmutableBitSet that) boolean
isEmpty()
removeAll
(ImmutableBitSet bitSet) Clears all bits in a given bit set.set
(int bit) set
(int fromIndex, int toIndex) Sets a range of bits, fromfrom
toto
- 1.boolean
wouldEqual
(ImmutableBitSet bitSet) Returns whether the bit set that would be created by this Builder would equal a given bit set.
-
Method Details
-
build
Builds an ImmutableBitSet from the contents of this Builder.After calling this method, the Builder cannot be used again.
-
buildAndReset
Builds an ImmutableBitSet from the contents of this Builder.After calling this method, the Builder may be used again.
-
build
Builds an ImmutableBitSet from the contents of this Builder, using an existing ImmutableBitSet if it happens to have the same contents.Supplying the existing bit set if useful for set operations, where there is a significant chance that the original bit set is unchanged. We save memory because we use the same copy. For example:
ImmutableBitSet primeNumbers; ImmutableBitSet hundreds = ImmutableBitSet.of(100, 200, 300); return primeNumbers.except(hundreds);
After calling this method, the Builder cannot be used again.
-
set
-
get
public boolean get(int bitIndex) -
clear
-
wouldEqual
Returns whether the bit set that would be created by this Builder would equal a given bit set. -
cardinality
public int cardinality()Returns the number of set bits. -
combine
Merges another builder. Does not modify the other builder. -
addAll
Sets all bits in a given bit set. -
addAll
Sets all bits in a given list of bits. -
addAll
Sets all bits in a given list ofint
s. -
removeAll
Clears all bits in a given bit set. -
set
Sets a range of bits, fromfrom
toto
- 1. -
isEmpty
public boolean isEmpty() -
intersect
-