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.



1030
1031
1032
1033
1034
1035
1036
1037
1038
# File 'lib/javaclass/attribute.rb', line 1030

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.



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

def index
  @index
end

#lengthObject

Returns the value of attribute length.



1056
1057
1058
# File 'lib/javaclass/attribute.rb', line 1056

def length
  @length
end

#name_indexObject

Returns the value of attribute name_index.



1057
1058
1059
# File 'lib/javaclass/attribute.rb', line 1057

def name_index
  @name_index
end

#signature_indexObject

Returns the value of attribute signature_index.



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

def signature_index
  @signature_index
end

#start_pcObject

Returns the value of attribute start_pc.



1055
1056
1057
# File 'lib/javaclass/attribute.rb', line 1055

def start_pc
  @start_pc
end

Instance Method Details

#nameObject

TODO



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

def name
  @java_class.get_constant_value( @name_index )
end

#signatureObject



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

def signature
  @java_class.get_constant_value( @signature_index )
end

#to_bytesObject



1048
1049
1050
1051
1052
1053
1054
# File 'lib/javaclass/attribute.rb', line 1048

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



1039
1040
1041
# File 'lib/javaclass/attribute.rb', line 1039

def to_s
  # TODO
end