Class: JavaClass::StackMapTableAttribute

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

Overview

スタックマップテーブル属性

Instance Attribute Summary collapse

Attributes inherited from Attribute

#java_class, #name_index

Instance Method Summary collapse

Methods inherited from Attribute

#name

Methods included from Base

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

Constructor Details

#initialize(java_class, name_index, stack_map_frame_entries = []) ⇒ StackMapTableAttribute

コンストラクタ

*java_class::属性の所有者であるJavaクラス *name_index::名前を示すconstant_poolのインデックス *stack_map_frame_entries::スタックマップフレームエントリ



1077
1078
1079
1080
# File 'lib/javaclass/attribute.rb', line 1077

def initialize( java_class, name_index, stack_map_frame_entries=[] )
  super( java_class, name_index)
  @stack_map_frame_entries = stack_map_frame_entries
end

Instance Attribute Details

#stack_map_frame_entriesObject

Returns the value of attribute stack_map_frame_entries.



1090
1091
1092
# File 'lib/javaclass/attribute.rb', line 1090

def stack_map_frame_entries
  @stack_map_frame_entries
end

Instance Method Details

#to_bytesObject



1081
1082
1083
1084
1085
1086
1087
1088
1089
# File 'lib/javaclass/attribute.rb', line 1081

def to_bytes
  bytes = super
  body = to_byte( @stack_map_frame_entries.length, 2 )
  @stack_map_frame_entries.each {|e|
    body += e.to_bytes()
  }
  bytes += to_byte( body.length, 4 )
  bytes += body
end