Class: Duby::JVM::Types::FloatType
- Inherits:
-
Number
- Object
- AST::Node
- AST::TypeReference
- Type
- PrimitiveType
- Number
- Duby::JVM::Types::FloatType
- Defined in:
- lib/duby/jvm/types/floats.rb
Direct Known Subclasses
Constant Summary
Constants included from MethodLookup
MethodLookup::BOOLEAN, MethodLookup::BYTE, MethodLookup::CHAR, MethodLookup::DOUBLE, MethodLookup::FLOAT, MethodLookup::INT, MethodLookup::LONG, MethodLookup::PrimitiveConversions, MethodLookup::SHORT
Constants inherited from AST::TypeReference
AST::TypeReference::ErrorType, AST::TypeReference::NoType, AST::TypeReference::NullType, AST::TypeReference::UnreachableType
Instance Attribute Summary
Attributes inherited from AST::TypeReference
Attributes included from AST::Named
Attributes inherited from AST::Node
#children, #inferred_type, #newline, #parent, #position
Instance Method Summary collapse
- #init_value(builder) ⇒ Object
- #literal(builder, value) ⇒ Object
- #prefix ⇒ Object
- #suffix ⇒ Object
- #widen(builder, type) ⇒ Object
Methods inherited from Number
#add_delegates, #add_intrinsics, #boolean_operator, #delegate_intrinsic, #jump_if, #math_operator, #math_type, #unary_operator
Methods inherited from PrimitiveType
#add_intrinsics, #convertible_to?, #initialize, #interfaces, #newarray, #primitive?, #primitive_type
Methods inherited from Type
#add_intrinsics, #add_method, #aload, #array?, #array_type, #assignable_from?, #astore, #basic_type, #compatible?, #component_type, #constructor, #declared_class_methods, #declared_instance_methods, #declared_intrinsics, #get_method, #initialize, #inspect, #interface?, #interfaces, #intrinsics, #is_parent, #iterable?, #java_method, #jvm_type, #load, #meta, #meta?, #newarray, #primitive?, #return, #store, #superclass, #to_source, #unmeta, #void?, #wide?
Methods included from MethodLookup
#each_is_exact, #each_is_exact_or_subtype_or_convertible, #find_jls, #find_method, #is_more_specific?, #log, #phase1, #phase2, #phase3, #primitive_convertible?
Methods inherited from AST::TypeReference
#==, #compatible?, #component_type, #eql?, #error?, #hash, #initialize, #is_parent, #iterable?, #meta?, #narrow, #primitive?, #to_s, #unmeta, #unreachable?
Methods included from AST::Named
Methods inherited from AST::Node
#[], #each, #expr?, #initialize, #inspect, #line_number, #log, #precompile, #resolve_if, #resolved!, #resolved?, #simple_name, #temp, #to_s
Constructor Details
This class inherits a constructor from Duby::JVM::Types::PrimitiveType
Instance Method Details
#init_value(builder) ⇒ Object
11 12 13 |
# File 'lib/duby/jvm/types/floats.rb', line 11 def init_value(builder) builder.fconst_0 end |
#literal(builder, value) ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/duby/jvm/types/floats.rb', line 15 def literal(builder, value) case value when 0.0 builder.fconst_0 when 1.0 builder.fconst_1 when 2.0 builder.fconst_2 else builder.ldc_float(value) end end |
#prefix ⇒ Object
3 4 5 |
# File 'lib/duby/jvm/types/floats.rb', line 3 def prefix 'f' end |
#suffix ⇒ Object
7 8 9 |
# File 'lib/duby/jvm/types/floats.rb', line 7 def suffix 'g' end |