Class: JavaClass::LocalVariableTypeTableAttribute
- Defined in:
- lib/javaclass/attribute.rb
Overview
ローカル変数の型テーブル属性
Instance Attribute Summary collapse
-
#local_variable_type_table ⇒ Object
Returns the value of attribute local_variable_type_table.
Attributes inherited from Attribute
Instance Method Summary collapse
-
#find_by_index(index) ⇒ Object
indexに対応するローカル変数型情報を取得します。 *index::ローカル変数名 戻り値::名前に対応するローカル変数型情報。見つからなければnil.
-
#initialize(java_class, name_index, local_variable_type_table = []) ⇒ LocalVariableTypeTableAttribute
constructor
コンストラクタ.
- #to_bytes ⇒ Object
Methods inherited from Attribute
Methods included from Base
#==, #===, #dump, #eql?, #hash, #to_byte
Constructor Details
#initialize(java_class, name_index, local_variable_type_table = []) ⇒ LocalVariableTypeTableAttribute
コンストラクタ
*java_class::属性の所有者であるJavaクラス*name_index::名前を示すconstant_poolのインデックス*local_variable_table::ローカル変数型テーブル
999 1000 1001 1002 |
# File 'lib/javaclass/attribute.rb', line 999 def initialize( java_class, name_index, local_variable_type_table=[] ) super( java_class, name_index) @local_variable_type_table = local_variable_type_table end |
Instance Attribute Details
#local_variable_type_table ⇒ Object
Returns the value of attribute local_variable_type_table.
1022 1023 1024 |
# File 'lib/javaclass/attribute.rb', line 1022 def local_variable_type_table @local_variable_type_table end |
Instance Method Details
#find_by_index(index) ⇒ Object
indexに対応するローカル変数型情報を取得します。
*index::ローカル変数名戻り値::名前に対応するローカル変数型情報。見つからなければnil
1008 1009 1010 1011 1012 |
# File 'lib/javaclass/attribute.rb', line 1008 def find_by_index( index ) return @local_variable_type_table.find {|l| l.index == index } end |
#to_bytes ⇒ Object
1013 1014 1015 1016 1017 1018 1019 1020 1021 |
# File 'lib/javaclass/attribute.rb', line 1013 def to_bytes bytes = super body = to_byte( @local_variable_type_table.length, 2 ) @local_variable_type_table.each {|l| body += l.to_bytes() } bytes += to_byte( body.length, 4 ) bytes += body end |