Class: JavaClass::LongConstant
Overview
Constant Summary
Constants inherited
from Constant
Constant::CONSTANT_Class, Constant::CONSTANT_Double, Constant::CONSTANT_Fieldref, Constant::CONSTANT_Float, Constant::CONSTANT_Integer, Constant::CONSTANT_InterfaceMethodref, Constant::CONSTANT_Long, Constant::CONSTANT_Methodref, Constant::CONSTANT_NameAndType, Constant::CONSTANT_String, Constant::CONSTANT_Utf8
Instance Attribute Summary
Attributes inherited from Constant
#java_class, #tag
Instance Method Summary
collapse
Methods included from Base
#==, #===, #dump, #eql?, #hash, #to_byte
Constructor Details
#initialize(java_class, tag = nil, bytes = nil) ⇒ LongConstant
コンストラクタ
*java_class::constantの所有者であるJavaクラス *tag::constantの種類を示すタグ *bytes::値
369
370
371
372
|
# File 'lib/javaclass/constant.rb', line 369
def initialize( java_class, tag=nil, bytes=nil )
super(java_class, tag)
@bytes = bytes
end
|
Instance Method Details
#bytes ⇒ Object
373
374
375
|
# File 'lib/javaclass/constant.rb', line 373
def bytes()
LongConstant::value_from_bytes(@bytes)
end
|
#bytes=(value) ⇒ Object
376
377
378
|
# File 'lib/javaclass/constant.rb', line 376
def bytes=(value)
@bytes = LongConstant::bytes_from_value(value) end
|
#to_bytes ⇒ Object
379
380
381
382
|
# File 'lib/javaclass/constant.rb', line 379
def to_bytes()
tmp = super
tmp += to_byte( @bytes, 8)
end
|
#to_s ⇒ Object
383
384
385
|
# File 'lib/javaclass/constant.rb', line 383
def to_s
bytes.to_s << "L"
end
|