Package org.apache.calcite.util
Class ImmutableBitSet.Rebuilder
- java.lang.Object
-
- org.apache.calcite.util.ImmutableBitSet.Builder
-
- org.apache.calcite.util.ImmutableBitSet.Rebuilder
-
- Enclosing class:
- ImmutableBitSet
private static class ImmutableBitSet.Rebuilder extends ImmutableBitSet.Builder
Refinement ofImmutableBitSet.Builder
that remembers its originalImmutableBitSet
and tries to use it whenbuild()
is called.
-
-
Field Summary
Fields Modifier and Type Field Description private ImmutableBitSet
originalBitSet
-
Constructor Summary
Constructors Modifier Constructor Description private
Rebuilder(ImmutableBitSet originalBitSet)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ImmutableBitSet
build()
Builds an ImmutableBitSet from the contents of this Builder.ImmutableBitSet
build(ImmutableBitSet bitSet)
Builds an ImmutableBitSet from the contents of this Builder, using an existing ImmutableBitSet if it happens to have the same contents.-
Methods inherited from class org.apache.calcite.util.ImmutableBitSet.Builder
addAll, addAll, addAll, cardinality, clear, intersect, isEmpty, removeAll, set, set, wouldEqual
-
-
-
-
Field Detail
-
originalBitSet
private final ImmutableBitSet originalBitSet
-
-
Constructor Detail
-
Rebuilder
private Rebuilder(ImmutableBitSet originalBitSet)
-
-
Method Detail
-
build
public ImmutableBitSet build()
Description copied from class:ImmutableBitSet.Builder
Builds an ImmutableBitSet from the contents of this Builder.After calling this method, the Builder cannot be used again.
- Overrides:
build
in classImmutableBitSet.Builder
-
build
public ImmutableBitSet build(ImmutableBitSet bitSet)
Description copied from class:ImmutableBitSet.Builder
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.
- Overrides:
build
in classImmutableBitSet.Builder
-
-