Class: JavaClass::LocalVariable
- Inherits:
-
Object
- Object
- JavaClass::LocalVariable
- Includes:
- Base, Converters
- Defined in:
- lib/javaclass/attribute.rb
Overview
ローカル変数
Instance Attribute Summary collapse
-
#descriptor_index ⇒ Object
Returns the value of attribute descriptor_index.
-
#index ⇒ Object
Returns the value of attribute index.
-
#length ⇒ Object
Returns the value of attribute length.
-
#name_index ⇒ Object
Returns the value of attribute name_index.
-
#start_pc ⇒ Object
Returns the value of attribute start_pc.
Instance Method Summary collapse
- #descriptor ⇒ Object
-
#initialize(java_class, start_pc = nil, length = nil, name_index = nil, descriptor_index = nil, index = nil) ⇒ LocalVariable
constructor
A new instance of LocalVariable.
- #name ⇒ Object
- #to_bytes ⇒ Object
- #to_s ⇒ Object
Methods included from Converters
convert_code, convert_field_descriptor, convert_method_descriptor
Methods included from Base
#==, #===, #dump, #eql?, #hash, #to_byte
Constructor Details
#initialize(java_class, start_pc = nil, length = nil, name_index = nil, descriptor_index = nil, index = nil) ⇒ LocalVariable
Returns a new instance of LocalVariable.
957 958 959 960 961 962 963 964 965 |
# File 'lib/javaclass/attribute.rb', line 957 def initialize( java_class, start_pc=nil, \ length=nil, name_index=nil, descriptor_index=nil, index=nil ) @java_class=java_class @start_pc = start_pc @length = length @name_index = name_index @descriptor_index = descriptor_index @index = index end |
Instance Attribute Details
#descriptor_index ⇒ Object
Returns the value of attribute descriptor_index.
985 986 987 |
# File 'lib/javaclass/attribute.rb', line 985 def descriptor_index @descriptor_index end |
#index ⇒ Object
Returns the value of attribute index.
986 987 988 |
# File 'lib/javaclass/attribute.rb', line 986 def index @index end |
#length ⇒ Object
Returns the value of attribute length.
983 984 985 |
# File 'lib/javaclass/attribute.rb', line 983 def length @length end |
#name_index ⇒ Object
Returns the value of attribute name_index.
984 985 986 |
# File 'lib/javaclass/attribute.rb', line 984 def name_index @name_index end |
#start_pc ⇒ Object
Returns the value of attribute start_pc.
982 983 984 |
# File 'lib/javaclass/attribute.rb', line 982 def start_pc @start_pc end |
Instance Method Details
#descriptor ⇒ Object
972 973 974 |
# File 'lib/javaclass/attribute.rb', line 972 def descriptor @java_class.get_constant_value( @descriptor_index ) end |
#name ⇒ Object
969 970 971 |
# File 'lib/javaclass/attribute.rb', line 969 def name @java_class.get_constant_value( @name_index ) end |
#to_bytes ⇒ Object
975 976 977 978 979 980 981 |
# File 'lib/javaclass/attribute.rb', line 975 def to_bytes bytes = to_byte( @start_pc, 2 ) bytes += to_byte( @length, 2 ) bytes += to_byte( @name_index, 2 ) bytes += to_byte( @descriptor_index, 2 ) bytes += to_byte( @index, 2 ) end |
#to_s ⇒ Object
966 967 968 |
# File 'lib/javaclass/attribute.rb', line 966 def to_s "#{convert_field_descriptor(descriptor)} #{name}" end |