Class: JavaClass::Attribute
- Inherits:
-
Object
- Object
- JavaClass::Attribute
- Includes:
- Base
- Defined in:
- lib/javaclass/attribute.rb
Overview
属性の基底クラス
Direct Known Subclasses
AnnotationDefaultAttribute, AnnotationsAttribute, CodeAttribute, ConstantValueAttribute, DeprecatedAttribute, EnclosingMethodAttribute, ExceptionsAttribute, InnerClassesAttribute, LineNumberTableAttribute, LocalVariableTableAttribute, LocalVariableTypeTableAttribute, ParameterAnnotationsAttribute, SignatureAttribute, SourceDebugExtensionAttribute, SourceFileAttribute, StackMapTableAttribute, SyntheticAttribute
Instance Attribute Summary collapse
-
#java_class ⇒ Object
Returns the value of attribute java_class.
-
#name_index ⇒ Object
Returns the value of attribute name_index.
Instance Method Summary collapse
-
#initialize(java_class, name_index) ⇒ Attribute
constructor
コンストラクタ.
-
#name ⇒ Object
属性名を取得する。.
- #to_bytes ⇒ Object
Methods included from Base
#==, #===, #dump, #eql?, #hash, #to_byte
Constructor Details
#initialize(java_class, name_index) ⇒ Attribute
コンストラクタ
*java_class::属性の所有者であるJavaクラス *name_index::名前を示すconstant_poolのインデックス
17 18 19 20 |
# File 'lib/javaclass/attribute.rb', line 17 def initialize( java_class, name_index ) @java_class = java_class @name_index = name_index end |
Instance Attribute Details
#java_class ⇒ Object
Returns the value of attribute java_class.
34 35 36 |
# File 'lib/javaclass/attribute.rb', line 34 def java_class @java_class end |
#name_index ⇒ Object
Returns the value of attribute name_index.
35 36 37 |
# File 'lib/javaclass/attribute.rb', line 35 def name_index @name_index end |
Instance Method Details
#name ⇒ Object
属性名を取得する。
戻り値::属性名
26 27 28 |
# File 'lib/javaclass/attribute.rb', line 26 def name @java_class.get_constant_value(@name_index) end |
#to_bytes ⇒ Object
30 31 32 |
# File 'lib/javaclass/attribute.rb', line 30 def to_bytes to_byte( @name_index, 2) end |