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.
961 962 963 964 965 966 967 968 969 |
# File 'lib/javaclass/attribute.rb', line 961 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.
989 990 991 |
# File 'lib/javaclass/attribute.rb', line 989 def descriptor_index @descriptor_index end |
#index ⇒ Object
Returns the value of attribute index.
990 991 992 |
# File 'lib/javaclass/attribute.rb', line 990 def index @index end |
#length ⇒ Object
Returns the value of attribute length.
987 988 989 |
# File 'lib/javaclass/attribute.rb', line 987 def length @length end |
#name_index ⇒ Object
Returns the value of attribute name_index.
988 989 990 |
# File 'lib/javaclass/attribute.rb', line 988 def name_index @name_index end |
#start_pc ⇒ Object
Returns the value of attribute start_pc.
986 987 988 |
# File 'lib/javaclass/attribute.rb', line 986 def start_pc @start_pc end |
Instance Method Details
#descriptor ⇒ Object
976 977 978 |
# File 'lib/javaclass/attribute.rb', line 976 def descriptor @java_class.get_constant_value( @descriptor_index ) end |
#name ⇒ Object
973 974 975 |
# File 'lib/javaclass/attribute.rb', line 973 def name @java_class.get_constant_value( @name_index ) end |
#to_bytes ⇒ Object
979 980 981 982 983 984 985 |
# File 'lib/javaclass/attribute.rb', line 979 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
970 971 972 |
# File 'lib/javaclass/attribute.rb', line 970 def to_s "#{convert_field_descriptor(descriptor)} #{name}" end |