Class: Origami::XRefToCompressedObject

Inherits:
Object
  • Object
show all
Defined in:
lib/origami/xreftable.rb

Overview

An xref poiting to an Object embedded in an ObjectStream.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(objstmno, index) ⇒ XRefToCompressedObject

Returns a new instance of XRefToCompressedObject.



347
348
349
350
# File 'lib/origami/xreftable.rb', line 347

def initialize(objstmno, index)
  @objstmno = objstmno
  @index = index
end

Instance Attribute Details

#indexObject

Returns the value of attribute index.



345
346
347
# File 'lib/origami/xreftable.rb', line 345

def index
  @index
end

#objstmnoObject

Returns the value of attribute objstmno.



345
346
347
# File 'lib/origami/xreftable.rb', line 345

def objstmno
  @objstmno
end

Instance Method Details

#free?Boolean

Returns:



368
369
370
# File 'lib/origami/xreftable.rb', line 368

def free?
  false
end

#to_xrefstm_data(type_w, field1_w, field2_w) ⇒ Object



352
353
354
355
356
357
358
359
360
361
362
# File 'lib/origami/xreftable.rb', line 352

def to_xrefstm_data(type_w, field1_w, field2_w)
  type_w <<= 3
  field1_w <<= 3
  field2_w <<= 3

  type = "\002".unpack1("B#{type_w}")
  objstmno = @objstmno.to_s(2).rjust(field1_w, '0')
  index = @index.to_s(2).rjust(field2_w, '0')

  [type, objstmno, index].pack("B#{type_w}B#{field1_w}B#{field2_w}")
end

#used?Boolean

Returns:



364
365
366
# File 'lib/origami/xreftable.rb', line 364

def used?
  true
end