Packages

class BitSet extends AnyRef

This class represents either a table of bits or a set of non-negative numbers.

This class is integrated with the collection framework (as a set of indices and obeys the collection semantic for methods such as #size (cardinality) or #equals (same set of indices).

Version

5.3, February 24, 2008

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. BitSet
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new BitSet(bitSize: Int)

    Creates a bit set of specified initial capacity (in bits).

    Creates a bit set of specified initial capacity (in bits). All bits are initially false. This constructor reserves enough space to represent the integers from 0 to bitSize-1.

    bitSize

    the initial capacity in bits.

  2. new BitSet()

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. def add(index: Index): Boolean

    Adds the specified index to this set.

    Adds the specified index to this set. This method is equivalent to set(index.intValue()).

    index

    the integer value to be appended to this set.

    returns

    true if this set did not contains the specified index; false otherwise.

  5. def and(that: BitSet): Unit

    Performs the logical AND operation on this bit set and the given bit set.

    Performs the logical AND operation on this bit set and the given bit set. This means it builds the intersection of the two sets. The result is stored into this bit set.

    that

    the second bit set.

  6. def andNot(that: BitSet): Unit

    Performs the logical AND operation on this bit set and the complement of the given bit set.

    Performs the logical AND operation on this bit set and the complement of the given bit set. This means it selects every element in the first set, that isn't in the second set. The result is stored into this bit set.

    that

    the second bit set

  7. def apply(bitIndex: Int): Boolean
  8. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  9. def cardinality(): Int

    Returns the number of bits set to true (or the size of this set).

    Returns the number of bits set to true (or the size of this set).

    returns

    the number of bits being set.

  10. def clear(fromIndex: Int, toIndex: Int): Unit

    Sets the bits from the specified fromIndex (inclusive) to the specified toIndex (exclusive) to false.

    Sets the bits from the specified fromIndex (inclusive) to the specified toIndex (exclusive) to false.

    fromIndex

    index of the first bit to be cleared.

    toIndex

    index after the last bit to be cleared.

    Exceptions thrown

    IndexOutOfBoundsException if (fromIndex < 0) | (toIndex < fromIndex)

  11. def clear(bitIndex: Int): Unit

    Removes the specified integer value from this set.

    Removes the specified integer value from this set. That is the corresponding bit is cleared.

    bitIndex

    a non-negative integer.

    Exceptions thrown

    IndexOutOfBoundsException if index < 0

  12. def clear(): Unit

    Sets all bits in the set to false (empty the set).

  13. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )
  14. def contains(bitIndex: Int): Boolean
  15. def copy(): BitSet
  16. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  17. def equals(obj: Any): Boolean
    Definition Classes
    BitSet → AnyRef → Any
  18. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  19. def flip(fromIndex: Int, toIndex: Int): Unit

    Sets a range of bits to the opposite value.

    Sets a range of bits to the opposite value.

    fromIndex

    the low index (inclusive).

    toIndex

    the high index (exclusive).

    Exceptions thrown

    IndexOutOfBoundsException if (fromIndex < 0) | (toIndex < fromIndex)

  20. def flip(bitIndex: Int): Unit

    Sets the bit at the index to the opposite value.

    Sets the bit at the index to the opposite value.

    bitIndex

    the index of the bit.

    Exceptions thrown

    IndexOutOfBoundsException if bitIndex < 0

  21. def get(bitIndex: Int): Boolean

    Returns true> if the specified integer is in this bit set; false otherwise.

    Returns true> if the specified integer is in this bit set; false otherwise.

    bitIndex

    a non-negative integer.

    returns

    the value of the bit at the specified index.

    Exceptions thrown

    IndexOutOfBoundsException if bitIndex < 0

  22. def getBits(): Array[Long]
  23. def getBitsLength(): Int
  24. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  25. def hashCode(): Int
    Definition Classes
    BitSet → AnyRef → Any
  26. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  27. def length(): Int
  28. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  29. def nextClearBit(fromIndex: Int): Int

    Returns the index of the next false bit, from the specified bit (inclusive).

    Returns the index of the next false bit, from the specified bit (inclusive).

    fromIndex

    the start location.

    returns

    the first false bit.

    Exceptions thrown

    IndexOutOfBoundsException if fromIndex < 0

  30. def nextSetBit(fromIndex: Int): Int

    Returns the index of the next true bit, from the specified bit (inclusive).

    Returns the index of the next true bit, from the specified bit (inclusive). If there is none, -1 is returned. The following code will iterates through the bit set:[code] for (int i=nextSetBit(0); i >= 0; i = nextSetBit(i + 1)) { ... }[/code]

    fromIndex

    the start location.

    returns

    the first false bit.

    Exceptions thrown

    IndexOutOfBoundsException if fromIndex < 0

  31. def nonEmpty(): Boolean
  32. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  33. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  34. def or(that: BitSet): Unit

    Performs the logical OR operation on this bit set and the one specified.

    Performs the logical OR operation on this bit set and the one specified. In other words, builds the union of the two sets. The result is stored into this bit set.

    that

    the second bit set.

  35. def set(fromIndex: Int, toIndex: Int, value: Boolean): Unit

    Sets the bits between from (inclusive) and to (exclusive) to the specified value.

    Sets the bits between from (inclusive) and to (exclusive) to the specified value.

    fromIndex

    the start range (inclusive).

    toIndex

    the end range (exclusive).

    value

    the value to set it to.

    Exceptions thrown

    IndexOutOfBoundsException if bitIndex < 0

  36. def set(fromIndex: Int, toIndex: Int): Unit

    Sets the bits from the specified fromIndex (inclusive) to the specified toIndex (exclusive) to true.

    Sets the bits from the specified fromIndex (inclusive) to the specified toIndex (exclusive) to true.

    fromIndex

    index of the first bit to be set.

    toIndex

    index after the last bit to be set.

    Exceptions thrown

    IndexOutOfBoundsException if (fromIndex < 0) | (toIndex < fromIndex)

  37. def set(bitIndex: Int, value: Boolean): Unit

    Sets the bit at the given index to the specified value.

    Sets the bit at the given index to the specified value.

    bitIndex

    the position to set.

    value

    the value to set it to.

    Exceptions thrown

    IndexOutOfBoundsException if bitIndex < 0

  38. def set(bitIndex: Int): Unit

    Adds the specified integer to this set (corresponding bit is set to true.

    Adds the specified integer to this set (corresponding bit is set to true.

    bitIndex

    a non-negative integer.

    Exceptions thrown

    IndexOutOfBoundsException if bitIndex < 0

  39. def setBits(arr: Array[Long]): Unit
  40. def size(): Int

    Returns the cardinality of this bit set (number of bits set).

    Returns the cardinality of this bit set (number of bits set).

    <P>Note: Unlike java.util.BitSet this method does not returns an approximation of the number of bits of space actually in use. This method is compliant with java.util.Collection meaning for size().

    returns

    the cardinality of this bit set.

  41. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  42. def toString(): String
    Definition Classes
    AnyRef → Any
  43. def update(bitIndex: Int, value: Boolean): Unit
  44. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  45. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  46. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )
  47. def xor(that: BitSet): Unit

    Performs the logical XOR operation on this bit set and the one specified.

    Performs the logical XOR operation on this bit set and the one specified. In other words, builds the symmetric remainder of the two sets (the elements that are in one set, but not in the other). The result is stored into this bit set.

    that

    the second bit set.

Inherited from AnyRef

Inherited from Any

Ungrouped