class JavaClass::ClassFile::Constants::SingleReference
Superclass of single reference constants like ConstantClass
(Class
) in the constant pool.
- Author
-
Peter Kofler
Attributes
first_index[R]
Public Class Methods
new(pool, data, start, name=nil)
click to toggle source
Define a single reference into pool from data beginning at start
Calls superclass method
JavaClass::ClassFile::Constants::Base::new
# File lib/javaclass/classfile/constants/single_reference.rb, line 15 def initialize(pool, data, start, name=nil) super(name) @tag = data.u1(start) @enclosing_pool = pool @first_index = data.u2(start+1) end
Public Instance Methods
dump()
click to toggle source
Return part of debug output.
Calls superclass method
JavaClass::ClassFile::Constants::Base#dump
# File lib/javaclass/classfile/constants/single_reference.rb, line 32 def dump super + "##{@first_index};\t// #{to_s}" end
first_value()
click to toggle source
Return the value, which is the referenced value from the pool.
# File lib/javaclass/classfile/constants/single_reference.rb, line 24 def first_value get(@first_index) end
to_s()
click to toggle source
# File lib/javaclass/classfile/constants/single_reference.rb, line 27 def to_s first_value end
Protected Instance Methods
get(ref)
click to toggle source
Get a reference ref from the enclosing_pool
# File lib/javaclass/classfile/constants/single_reference.rb, line 39 def get(ref) @enclosing_pool[ref].to_s end