class QuartzTorrent::EmptyBitfield

A bitfield that is always empty.

Attributes

length[R]

Length of the Bitfield in bits.

Public Class Methods

new() click to toggle source
# File lib/quartz_torrent/bitfield.rb, line 230
def initialize
  @length = 0
end

Public Instance Methods

allClear?() click to toggle source

Are all bits in the Bitfield clear?

# File lib/quartz_torrent/bitfield.rb, line 261
def allClear?
  true
end
allSet?() click to toggle source

Are all bits in the Bitfield set?

# File lib/quartz_torrent/bitfield.rb, line 256
def allSet?
  false
end
byteLength() click to toggle source

Length of the Bitfield in bytes.

# File lib/quartz_torrent/bitfield.rb, line 238
def byteLength
  0
end
clear(bit) click to toggle source

Clear the bit at index ‘bit’ to 0.

# File lib/quartz_torrent/bitfield.rb, line 247
def clear(bit)
end
clearAll() click to toggle source

Clear all bits in the field to 0.

# File lib/quartz_torrent/bitfield.rb, line 270
def clearAll
end
compliment() click to toggle source

Calculate the compliment of this bitfield, and return the result as a new bitfield.

# File lib/quartz_torrent/bitfield.rb, line 297
def compliment
  self
end
compliment!() click to toggle source

Update this bitfield to be the compliment of itself.

# File lib/quartz_torrent/bitfield.rb, line 302
def compliment!
  self
end
copyFrom(bitfield) click to toggle source

Set the contents of this bitfield to be the same as the passed bitfield. An exception is thrown if the passed bitfield is smaller than this.

# File lib/quartz_torrent/bitfield.rb, line 292
def copyFrom(bitfield)
end
countSet() click to toggle source

Count the number of bits that are set. Slow: could use lookup table.

# File lib/quartz_torrent/bitfield.rb, line 321
def countSet
  0
end
intersection(bitfield) click to toggle source

Calculate the intersection of this bitfield and the passed bitfield, and return the result as a new bitfield.

# File lib/quartz_torrent/bitfield.rb, line 281
def intersection(bitfield)
  self
end
intersection!(bitfield) click to toggle source

Update this bitfield to be the intersection of this bitfield and the passed bitfield.

# File lib/quartz_torrent/bitfield.rb, line 286
def intersection!(bitfield)
  self
end
serialize() click to toggle source

Serialize this bitfield as a string.

# File lib/quartz_torrent/bitfield.rb, line 307
def serialize
  ""
end
set(bit) click to toggle source

Set the bit at index ‘bit’ to 1.

# File lib/quartz_torrent/bitfield.rb, line 243
def set(bit)
end
set?(bit) click to toggle source

Returns true if the bit is set, false otherwise.

# File lib/quartz_torrent/bitfield.rb, line 251
def set?(bit)
  false
end
setAll() click to toggle source

Set all bits in the field to 1.

# File lib/quartz_torrent/bitfield.rb, line 266
def setAll
end
to_s(groupsOf = 8) click to toggle source

Return a display string representing the bitfield.

# File lib/quartz_torrent/bitfield.rb, line 316
def to_s(groupsOf = 8)
  "empty"
end
union(bitfield) click to toggle source

Calculate the union of this bitfield and the passed bitfield, and return the result as a new bitfield.

# File lib/quartz_torrent/bitfield.rb, line 275
def union(bitfield)
  self
end
unserialize(s) click to toggle source

Unserialize this bitfield from a string.

# File lib/quartz_torrent/bitfield.rb, line 312
def unserialize(s)
end