Class: JavaClass::ExceptionsAttribute
- Defined in:
- lib/javaclass/attribute.rb
Overview
例外属性
Instance Attribute Summary collapse
-
#exception_index_table ⇒ Object
例外テーブル.
Attributes inherited from Attribute
Instance Method Summary collapse
-
#exceptions ⇒ Object
例外の配列を取得する。.
-
#initialize(java_class, name_index, exception_index_table) ⇒ ExceptionsAttribute
constructor
コンストラクタ.
- #to_bytes ⇒ Object
- #to_s ⇒ Object
Methods inherited from Attribute
Methods included from Base
#==, #===, #dump, #eql?, #hash, #to_byte
Constructor Details
#initialize(java_class, name_index, exception_index_table) ⇒ ExceptionsAttribute
コンストラクタ
*java_class::属性の所有者であるJavaクラス *name_index::名前を示すconstant_poolのインデックス *constant_value_index::定数値を示すconstant_poolのインデックス
91 92 93 94 |
# File 'lib/javaclass/attribute.rb', line 91 def initialize( java_class, name_index, exception_index_table ) super( java_class, name_index) @exception_index_table = exception_index_table end |
Instance Attribute Details
#exception_index_table ⇒ Object
例外テーブル
118 119 120 |
# File 'lib/javaclass/attribute.rb', line 118 def exception_index_table @exception_index_table end |
Instance Method Details
#exceptions ⇒ Object
例外の配列を取得する。
戻り値::例外の配列
100 101 102 103 104 |
# File 'lib/javaclass/attribute.rb', line 100 def exceptions exception_index_table.map() {|index| @java_class.get_constant(index) } end |
#to_bytes ⇒ Object
108 109 110 111 112 113 114 115 116 |
# File 'lib/javaclass/attribute.rb', line 108 def to_bytes bytes = super bytes += to_byte( 2+(2 * (@exception_index_table.length)), 4) bytes += to_byte( @exception_index_table.length, 2) @exception_index_table.each {|index| bytes += to_byte( index, 2) } return bytes end |
#to_s ⇒ Object
105 106 107 |
# File 'lib/javaclass/attribute.rb', line 105 def to_s "throws " << exceptions.map(){|ex| ex.name }.join(", ") end |