Class: JavaClass::DoubleConstant
- Defined in:
- lib/javaclass/constant.rb
Overview
DoubleのConstant
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
Instance Method Summary collapse
- #bytes ⇒ Object
- #bytes=(value) ⇒ Object
-
#initialize(java_class, tag = nil, bytes = nil) ⇒ DoubleConstant
constructor
===コンストラクタ.
- #to_bytes ⇒ Object
- #to_s ⇒ Object
Methods included from Base
#==, #===, #dump, #eql?, #hash, #to_byte
Constructor Details
#initialize(java_class, tag = nil, bytes = nil) ⇒ DoubleConstant
===コンストラクタ
*java_class::constantの所有者であるJavaクラス *tag::constantの種類を示すタグ *bytes::値
414 415 416 417 |
# File 'lib/javaclass/constant.rb', line 414 def initialize( java_class, tag=nil, bytes=nil ) super(java_class, tag) @bytes = bytes end |
Instance Method Details
#bytes ⇒ Object
418 419 420 |
# File 'lib/javaclass/constant.rb', line 418 def bytes() DoubleConstant.value_from_bytes(@bytes) end |
#bytes=(value) ⇒ Object
421 422 423 |
# File 'lib/javaclass/constant.rb', line 421 def bytes=(value) raise "not implements yet." # TODO end |
#to_bytes ⇒ Object
424 425 426 427 |
# File 'lib/javaclass/constant.rb', line 424 def to_bytes() tmp = super tmp += to_byte( @bytes, 8) end |
#to_s ⇒ Object
428 429 430 431 432 433 |
# File 'lib/javaclass/constant.rb', line 428 def to_s tmp = bytes str =tmp.to_s str << "D" unless ( tmp.kind_of?(Float) && (tmp.nan? || tmp.infinite? )) return str end |