Class | JavaClass::ClassFile::Constants::Value |
In: |
lib/javaclass/classfile/constants/value.rb
|
Parent: | Base |
Superclass of value constants like ConstantInt (Integer) in the constant pool.
Author: | Peter Kofler |
value | [R] |
Create a constant value with an optional downcase name
# File lib/javaclass/classfile/constants/value.rb, line 14 def initialize(name=self.class.to_s[/::[^:]+$/][10..-1].downcase) super(name) end
Return part of debug output.
# File lib/javaclass/classfile/constants/value.rb, line 24 def dump super + to_s end
Return the value as string.
# File lib/javaclass/classfile/constants/value.rb, line 19 def to_s @value.to_s end
Define a value from data beginning at position start with the size in bytes and slots (1 or 2).
# File lib/javaclass/classfile/constants/value.rb, line 31 def get_value(data, start, size, slots=1) @tag = data.u1(start) @size = size @slots = slots data[start+1..start+size-1] end