Class AMQP::BitSet
In: lib/amqp/bit_set.rb
Parent: Object

Very minimalistic, pure Ruby implementation of bit set. Inspired by java.util.BitSet, although significantly smaller in scope.

Methods

[]   clear   get   init_words   new   set   unset   word_index  

Constants

ADDRESS_BITS_PER_WORD = 6   API
BITS_PER_WORD = (1 << ADDRESS_BITS_PER_WORD)
WORD_MASK = 0xffffffffffffffff

Public Class methods

@param [Integer] Number of bits in the set @api public

Public Instance methods

[](i)

Alias for get

Clears all bits in the set @api public

Fetches flag value for given bit.

@param [Integer] A bit to fetch @return [Boolean] true if given bit is set, false otherwise @api public

Sets (flags) given bit. This method allows bits to be set more than once in a row, no exception will be raised.

@param [Integer] A bit to set @api public

Unsets (unflags) given bit. This method allows bits to be unset more than once in a row, no exception will be raised.

@param [Integer] A bit to unset @api public

Protected Instance methods

[Validate]