Skip to content
FutureBlitz

    Install

    Import std.collections.bit_set

    std.collections.bit_set

    BitSet: a Set of Ints from 0 up, a bit each in an array of words, which grows to hold the largest. Adding, removing, and finding a value take the same time however many there are, and the Set algebra goes a word at a time.

    std/collections/bit_set.fb

    Types

    BitSet class

    @DebugElements Public Class BitSet Implements Iterable<Int>, Cloneable, Defaultable, Hashable

    A set of Ints that aren't negative, a bit each, for many small numbers in little space.

    std/collections/bit_set.fb, line 9

    • Public Property Count: Int property #

      How many values it holds.

    • @PanicsAtCaller Public Method Add(value: Int): Bool method #

      Adds the value, and tells whether it's new. A negative value panics.

    • @PanicsAtCaller Public Method AddAll(values: Iterable<Int>) method #

      Adds each of the values, which are all read first. A negative value panics.

    • Public Method Remove(value: Int): Bool method #

      Removes the value, and tells whether it was there.

    • Public Method Contains(value: Int): Bool method #

      Whether it holds value.

    • Public Method Clear() method #

      Takes every value out.

    • Public Method First(): Int? method #

      The smallest value, or Null when there's none.

    • Public Method Last(): Int? method #

      The largest value, or Null when there's none.

    • Public Method Union(other: BitSet): BitSet method #

      A new BitSet of the values in either.

    • Public Method Intersect(other: BitSet): BitSet method #

      A new BitSet of the values in both.

    • Public Method Difference(other: BitSet): BitSet method #

      A new BitSet of this one's values that other doesn't have.

    • Public Method SymmetricDifference(other: BitSet): BitSet method #

      A new BitSet of the values in one but not the other.

    • Public Method AddAll(other: BitSet) method #

      Adds each of other's values.

    • Public Method RemoveAll(other: BitSet) method #

      Removes each of other's values.

    • Public Method KeepOnly(other: BitSet) method #

      Keeps only the values other has too.

    • Public Method IsSubsetOf(other: BitSet): Bool method #

      Whether each of its values is in other.

    • Public Method IsSupersetOf(other: BitSet): Bool method #

      Whether it has each of other's values.

    • Public Method Overlaps(other: BitSet): Bool method #

      Whether the two have a value in common.

    • Public Method ToArray(): Int[] method #

      The values, smallest first, in a new array.

    • Public Static Method DefaultValue(): BitSet static method #

      A new, empty BitSet.

    • Public Method Clone(): BitSet method #

      A new BitSet with the same values.

    • Operator ==(a: BitSet, b: BitSet): Bool operator #

      Two BitSets are equal when they have the same values.

    • Public Method Hash(): UInt64 method #

      Its hash, the same for values that are equal.

      Doc from std.core.interfaces.Hashable.Hash.

    • Public Method Iterate(): BitSetIterator method #

      The values, smallest first. Adding or removing one while going over them panics.

    BitSetIterator struct

    Public Struct BitSetIterator Implements Iterator<Int>

    The values of a BitSet, smallest first, which For ... In goes over.

    std/collections/bit_set.fb, line 240

    Extends

    BitSet extend

    Extend BitSet Implements Printable

    No doc comment.

    std/collections/bit_set.fb, line 265

    Report an issue with this page or with FutureBlitz on GitHub.