Class: JavaClass::ArrayAnnotationElementValue
- Inherits:
-
AnnotationElementValue
- Object
- AnnotationElementValue
- JavaClass::ArrayAnnotationElementValue
- Defined in:
- lib/javaclass/attribute.rb
Overview
配列型のアノテーションデータ
Instance Attribute Summary collapse
-
#array ⇒ Object
Returns the value of attribute array.
Attributes inherited from AnnotationElementValue
Instance Method Summary collapse
-
#initialize(java_class, tag = nil, array = []) ⇒ ArrayAnnotationElementValue
constructor
コンストラクタ.
- #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, tag = nil, array = []) ⇒ ArrayAnnotationElementValue
コンストラクタ
*java_class::属性の所有者であるJavaクラス *tag::データの種別を示すconstant_poolのインデックス *array::配列
676 677 678 679 |
# File 'lib/javaclass/attribute.rb', line 676 def initialize( java_class, tag=nil, array=[] ) super( java_class, tag ) @array = array end |
Instance Attribute Details
#array ⇒ Object
Returns the value of attribute array.
692 693 694 |
# File 'lib/javaclass/attribute.rb', line 692 def array @array end |
Instance Method Details
#to_bytes ⇒ Object
683 684 685 686 687 688 689 690 |
# File 'lib/javaclass/attribute.rb', line 683 def to_bytes bytes = super bytes += to_byte( @array.length, 2 ) @array.each {|a| bytes += a.to_bytes() } return bytes end |
#to_s ⇒ Object
680 681 682 |
# File 'lib/javaclass/attribute.rb', line 680 def to_s "[" << @array.map{|a| a.to_s }.join(",") << "]" end |