Class: JavaClass::LocalVariableType

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

Overview

ローカル変数の型

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Base

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

Constructor Details

#initialize(java_class, start_pc = nil, length = nil, name_index = nil, signature_index = nil, index = nil) ⇒ LocalVariableType

Returns a new instance of LocalVariableType.



1034
1035
1036
1037
1038
1039
1040
1041
1042
# File 'lib/javaclass/attribute.rb', line 1034

def initialize( java_class, start_pc=nil, \
  length=nil, name_index=nil, signature_index=nil, index=nil )
  @java_class=java_class
  @start_pc = start_pc
  @length = length
  @name_index = name_index
  @signature_index = signature_index
  @index = index
end

Instance Attribute Details

#indexObject

Returns the value of attribute index.



1063
1064
1065
# File 'lib/javaclass/attribute.rb', line 1063

def index
  @index
end

#lengthObject

Returns the value of attribute length.



1060
1061
1062
# File 'lib/javaclass/attribute.rb', line 1060

def length
  @length
end

#name_indexObject

Returns the value of attribute name_index.



1061
1062
1063
# File 'lib/javaclass/attribute.rb', line 1061

def name_index
  @name_index
end

#signature_indexObject

Returns the value of attribute signature_index.



1062
1063
1064
# File 'lib/javaclass/attribute.rb', line 1062

def signature_index
  @signature_index
end

#start_pcObject

Returns the value of attribute start_pc.



1059
1060
1061
# File 'lib/javaclass/attribute.rb', line 1059

def start_pc
  @start_pc
end

Instance Method Details

#nameObject

TODO



1046
1047
1048
# File 'lib/javaclass/attribute.rb', line 1046

def name
  @java_class.get_constant_value( @name_index )
end

#signatureObject



1049
1050
1051
# File 'lib/javaclass/attribute.rb', line 1049

def signature
  @java_class.get_constant_value( @signature_index )
end

#to_bytesObject



1052
1053
1054
1055
1056
1057
1058
# File 'lib/javaclass/attribute.rb', line 1052

def to_bytes
  bytes = to_byte( @start_pc, 2 )
  bytes += to_byte( @length, 2 )
  bytes += to_byte( @name_index, 2 )
  bytes += to_byte( @signature_index, 2 )
  bytes += to_byte( @index, 2 )
end

#to_sObject



1043
1044
1045
# File 'lib/javaclass/attribute.rb', line 1043

def to_s
  # TODO
end