Class: JavaClass::SourceDebugExtensionAttribute

Inherits:
Attribute
  • Object
show all
Defined in:
lib/javaclass/attribute.rb

Overview

ソースデバッグ拡張属性

Instance Attribute Summary collapse

Attributes inherited from Attribute

#java_class, #name_index

Instance Method Summary collapse

Methods inherited from Attribute

#name

Methods included from Base

#==, #===, #dump, #eql?, #hash, #to_byte

Constructor Details

#initialize(java_class, name_index, debug_extension) ⇒ SourceDebugExtensionAttribute

コンストラクタ

*java_class::属性の所有者であるJavaクラス *name_index::名前を示すconstant_poolのインデックス *debug_extension::デバッグ情報



360
361
362
363
# File 'lib/javaclass/attribute.rb', line 360

def initialize( java_class, name_index, debug_extension )
  super( java_class, name_index)
  @debug_extension = debug_extension
end

Instance Attribute Details

#debug_extensionObject

デバッグ情報



378
379
380
# File 'lib/javaclass/attribute.rb', line 378

def debug_extension
  @debug_extension
end

Instance Method Details

#to_bytesObject



367
368
369
370
371
372
373
374
375
# File 'lib/javaclass/attribute.rb', line 367

def to_bytes
  bytes = super
  body = []
  @debug_extension.each_byte {|i|
    body += to_byte( i, 1 )
  }
  bytes += to_byte( body.length, 4 )
  bytes += body
end

#to_sObject



364
365
366
# File 'lib/javaclass/attribute.rb', line 364

def to_s
  "// debug_extension #{debug_extension}"
end