Class: JavaClass::SourceFileAttribute
- Defined in:
- lib/javaclass/attribute.rb
Overview
ソースファイル属性
Instance Attribute Summary collapse
-
#source_file_index ⇒ Object
ソースファイルを示すconstant_poolのインデックス.
Attributes inherited from Attribute
Instance Method Summary collapse
-
#initialize(java_class, name_index, source_file_index) ⇒ SourceFileAttribute
constructor
コンストラクタ.
-
#source_file ⇒ Object
ソースファイル名を取得する。.
- #to_bytes ⇒ Object
- #to_s ⇒ Object
Methods inherited from Attribute
Methods included from Base
#==, #===, #dump, #eql?, #hash, #to_byte
Constructor Details
#initialize(java_class, name_index, source_file_index) ⇒ SourceFileAttribute
コンストラクタ
*java_class::属性の所有者であるJavaクラス *name_index::名前を示すconstant_poolのインデックス *source_file_index::ソースファイルを示すconstant_poolのインデックス
325 326 327 328 |
# File 'lib/javaclass/attribute.rb', line 325 def initialize( java_class, name_index, source_file_index ) super( java_class, name_index) @source_file_index = source_file_index end |
Instance Attribute Details
#source_file_index ⇒ Object
ソースファイルを示すconstant_poolのインデックス
346 347 348 |
# File 'lib/javaclass/attribute.rb', line 346 def source_file_index @source_file_index end |
Instance Method Details
#source_file ⇒ Object
ソースファイル名を取得する。
戻り値::ソースファイル名
334 335 336 |
# File 'lib/javaclass/attribute.rb', line 334 def source_file @java_class.get_constant_value(@source_file_index) end |
#to_bytes ⇒ Object
340 341 342 343 344 |
# File 'lib/javaclass/attribute.rb', line 340 def to_bytes bytes = super bytes += to_byte( 2, 4) bytes += to_byte( @source_file_index, 2) end |
#to_s ⇒ Object
337 338 339 |
# File 'lib/javaclass/attribute.rb', line 337 def to_s "// source #{source_file}" end |