Class: JavaClass::ClassFile::Constants::DoubleReference
- Inherits:
-
SingleReference
- Object
- Base
- SingleReference
- JavaClass::ClassFile::Constants::DoubleReference
- Defined in:
- lib/javaclass/classfile/constants/double_reference.rb
Overview
Superclass of double reference constants like ConstantField
(FieldRef
) in the constant pool.
- Author
-
Peter Kofler
Direct Known Subclasses
ConstantField, ConstantInterfaceMethod, ConstantMethod, ConstantNameAndType
Instance Attribute Summary collapse
-
#second_index ⇒ Object
readonly
Returns the value of attribute second_index.
Attributes inherited from SingleReference
Attributes inherited from Base
Instance Method Summary collapse
-
#dump ⇒ Object
Return part of debug output.
-
#initialize(pool, data, start, name = nil) ⇒ DoubleReference
constructor
Define a double reference into pool from data beginning at start.
-
#second_value ⇒ Object
Return the second value, which is the referenced value from the pool.
-
#to_s ⇒ Object
Return the value, which are both referenced values from the pool.
Methods inherited from SingleReference
Constructor Details
#initialize(pool, data, start, name = nil) ⇒ DoubleReference
Define a double reference into pool from data beginning at start
15 16 17 18 19 20 |
# File 'lib/javaclass/classfile/constants/double_reference.rb', line 15 def initialize(pool, data, start, name=nil) super(pool, data, start, name) @size = 5 @second_index = data.u2(start+3) end |
Instance Attribute Details
#second_index ⇒ Object (readonly)
Returns the value of attribute second_index.
12 13 14 |
# File 'lib/javaclass/classfile/constants/double_reference.rb', line 12 def second_index @second_index end |
Instance Method Details
#dump ⇒ Object
Return part of debug output.
33 34 35 |
# File 'lib/javaclass/classfile/constants/double_reference.rb', line 33 def dump "#{@name}\t##{@first_index}.##{@second_index};\t// #{to_s}" end |
#second_value ⇒ Object
Return the second value, which is the referenced value from the pool.
23 24 25 |
# File 'lib/javaclass/classfile/constants/double_reference.rb', line 23 def second_value get(@second_index) end |
#to_s ⇒ Object
Return the value, which are both referenced values from the pool.
28 29 30 |
# File 'lib/javaclass/classfile/constants/double_reference.rb', line 28 def to_s "#{super}.#{second_value}" end |