class JavaClass::ClassFile::Constants::DoubleReference

Superclass of double reference constants like ConstantField (FieldRef) in the constant pool.

Author

Peter Kofler

Attributes

second_index[R]

Public Class Methods

new(pool, data, start, name=nil) click to toggle source

Define a double reference into pool from data beginning at start

Calls superclass method
# 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

Public Instance Methods

dump() click to toggle source

Return part of debug output.

# File lib/javaclass/classfile/constants/double_reference.rb, line 33
def dump
  "#{@name}\t##{@first_index}.##{@second_index};\t//  #{to_s}"
end
second_value() click to toggle source

Return the second value, which is the referenced value from the pool.

# File lib/javaclass/classfile/constants/double_reference.rb, line 23
def second_value
  get(@second_index)
end
to_s() click to toggle source

Return the value, which are both referenced values from the pool.

# File lib/javaclass/classfile/constants/double_reference.rb, line 28
def to_s
  "#{super}.#{second_value}"
end