org.jruby
Class RubyFloat

java.lang.Object
  extended byorg.jruby.RubyObject
      extended byorg.jruby.RubyNumeric
          extended byorg.jruby.RubyFloat
All Implemented Interfaces:
java.lang.Cloneable, IRubyObject

public class RubyFloat
extends RubyNumeric

Author:
jpetersen

Nested Class Summary
 
Nested classes inherited from class org.jruby.RubyNumeric
RubyNumeric.InvalidIntegerException, RubyNumeric.NumberTooLargeException
 
Nested classes inherited from class org.jruby.RubyObject
RubyObject.Finalizer
 
Field Summary
 
Fields inherited from class org.jruby.RubyNumeric
DBL_EPSILON, NUMERIC_ALLOCATOR
 
Fields inherited from class org.jruby.RubyObject
instanceVariables, isTrue, metaClass, NEVER, OBJECT_ALLOCATOR
 
Fields inherited from interface org.jruby.runtime.builtin.IRubyObject
NULL_ARRAY
 
Constructor Summary
RubyFloat(Ruby runtime)
           
RubyFloat(Ruby runtime, double value)
           
 
Method Summary
 IRubyObject abs()
          flo_abs
 IRubyObject ceil()
          flo_ceil
 IRubyObject cmp(IRubyObject other)
          flo_cmp
 IRubyObject coerce(IRubyObject other)
          flo_coerce
protected  int compareValue(RubyNumeric other)
           
 RubyFloat convertToFloat()
           
static RubyClass createFloatClass(Ruby runtime)
           
 IRubyObject divmod(IRubyObject other)
          flo_divmod
 IRubyObject eql_p(IRubyObject other)
          flo_eql
 IRubyObject equal(IRubyObject other)
          flo_eq
 IRubyObject fdiv(IRubyObject other)
          flo_div
 IRubyObject finite_p()
          flo_is_finite_p
 IRubyObject floor()
          loor
 IRubyObject ge(IRubyObject other)
          flo_ge
 double getDoubleValue()
           
 java.lang.Class getJavaClass()
          RubyMethod getJavaClass.
 long getLongValue()
           
 int getNativeTypeIndex()
          This is overridden in the other concrete Java builtins to provide a fast way to determine what type they are.
 double getValue()
          Getter for property value.
 IRubyObject gt(IRubyObject other)
          flo_gt
 RubyFixnum hash()
          flo_hash
 int hashCode()
           
static IRubyObject induced_from(IRubyObject recv, IRubyObject number)
          rb_flo_induced_from
 IRubyObject infinite_p()
          flo_is_infinite_p
 IRubyObject le(IRubyObject other)
          flo_le
 IRubyObject lt(IRubyObject other)
          flo_lt
static void marshalTo(RubyFloat aFloat, MarshalStream output)
           
 IRubyObject minus(IRubyObject other)
          flo_minus
 IRubyObject mod(IRubyObject other)
          flo_mod
 IRubyObject mul(IRubyObject other)
          flo_mul
 IRubyObject nan_p()
          flo_is_nan_p
static RubyFloat newFloat(Ruby runtime, double value)
           
 IRubyObject plus(IRubyObject other)
          flo_plus
 IRubyObject pow(IRubyObject other)
          flo_pow
 IRubyObject round()
          flo_round
 IRubyObject to_f()
          flo_fo
 IRubyObject to_s()
          flo_to_s
 IRubyObject truncate()
          flo_truncate
 IRubyObject uminus()
          flo_uminus
static RubyFloat unmarshalFrom(UnmarshalStream input)
           
 IRubyObject zero_p()
          flo_zero_p
 
Methods inherited from class org.jruby.RubyNumeric
asNumeric, callCoerced, callCoerced, checkInt, coerceBin, coerceBody, coerceCmp, coerceRelOp, createNumericClass, dbl_cmp, dbl2num, div, doCoerce, fix2int, fix2long, getCoerced, init_copy, int_p, int2fix, modulo, newNumeric, nonzero_p, num2dbl, num2fix, num2int, num2long, quo, remainder, sadded, step, str2fnum, str2fnum, str2inum, str2inum, to_int, uplus
 
Methods inherited from class org.jruby.RubyObject
addFinalizer, anyToString, asString, asSymbol, attachToObjectSpace, callInit, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethodMissingIfNecessary, callSuper, checkArrayType, checkFrozen, checkStringType, compilerCallMethod, compilerCallMethodWithIndex, convertToArray, convertToHash, convertToInteger, convertToString, convertToType, convertToType, convertToType, convertToTypeWithCheck, createObjectClass, dataGetStruct, dataWrapStruct, display, doClone, dup, eql, eqlInternal, equalInternal, equals, evalSimple, evalUnder, evalWithBinding, extend, freeze, frozen, getInstanceVariable, getInstanceVariables, getInstanceVariablesSnapshot, getMetaClass, getRuntime, getSingletonClass, getSingletonClassClone, getType, id_deprecated, id, infectBy, inherited, initCopy, initialize_copy, initialize, inspect, instance_eval, instance_exec, instance_of, instance_variable_get, instance_variable_set, instance_variables, instanceVariableNames, isFalse, isFrozen, isImmediate, isKindOf, isNil, isSingleton, isTaint, isTrue, kind_of, makeMetaClass, match, method, methods, nil_p, obj_equal, private_methods, protected_methods, public_methods, puts, rbClone, remove_instance_variable, removeFinalizers, removeInstanceVariable, respond_to, respondsTo, safeGetInstanceVariables, safeHasInstanceVariables, send, setFrozen, setInstanceVariable, setInstanceVariable, setInstanceVariables, setMetaClass, setTaint, singleton_methods, specificEval, taint, tainted, testFrozen, toString, trueFalseNil, trueFalseNil, type_deprecated, type, untaint
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RubyFloat

public RubyFloat(Ruby runtime)

RubyFloat

public RubyFloat(Ruby runtime,
                 double value)
Method Detail

createFloatClass

public static RubyClass createFloatClass(Ruby runtime)

getNativeTypeIndex

public int getNativeTypeIndex()
Description copied from class: RubyObject
This is overridden in the other concrete Java builtins to provide a fast way to determine what type they are.

Specified by:
getNativeTypeIndex in interface IRubyObject
Overrides:
getNativeTypeIndex in class RubyObject

getJavaClass

public java.lang.Class getJavaClass()
Description copied from interface: IRubyObject
RubyMethod getJavaClass.

Specified by:
getJavaClass in interface IRubyObject
Overrides:
getJavaClass in class RubyObject

getValue

public double getValue()
Getter for property value.

Returns:
Value of property value.

getDoubleValue

public double getDoubleValue()
Overrides:
getDoubleValue in class RubyNumeric

getLongValue

public long getLongValue()
Overrides:
getLongValue in class RubyNumeric

convertToFloat

public RubyFloat convertToFloat()
Specified by:
convertToFloat in interface IRubyObject
Overrides:
convertToFloat in class RubyObject

compareValue

protected int compareValue(RubyNumeric other)

newFloat

public static RubyFloat newFloat(Ruby runtime,
                                 double value)

induced_from

public static IRubyObject induced_from(IRubyObject recv,
                                       IRubyObject number)
rb_flo_induced_from


to_s

public IRubyObject to_s()
flo_to_s

Overrides:
to_s in class RubyObject

coerce

public IRubyObject coerce(IRubyObject other)
flo_coerce

Overrides:
coerce in class RubyNumeric

uminus

public IRubyObject uminus()
flo_uminus

Overrides:
uminus in class RubyNumeric

plus

public IRubyObject plus(IRubyObject other)
flo_plus


minus

public IRubyObject minus(IRubyObject other)
flo_minus


mul

public IRubyObject mul(IRubyObject other)
flo_mul


fdiv

public IRubyObject fdiv(IRubyObject other)
flo_div


mod

public IRubyObject mod(IRubyObject other)
flo_mod


divmod

public IRubyObject divmod(IRubyObject other)
flo_divmod

Overrides:
divmod in class RubyNumeric

pow

public IRubyObject pow(IRubyObject other)
flo_pow


equal

public IRubyObject equal(IRubyObject other)
flo_eq

Specified by:
equal in interface IRubyObject
Overrides:
equal in class RubyNumeric

cmp

public IRubyObject cmp(IRubyObject other)
flo_cmp

Overrides:
cmp in class RubyNumeric

gt

public IRubyObject gt(IRubyObject other)
flo_gt


ge

public IRubyObject ge(IRubyObject other)
flo_ge


lt

public IRubyObject lt(IRubyObject other)
flo_lt


le

public IRubyObject le(IRubyObject other)
flo_le


eql_p

public IRubyObject eql_p(IRubyObject other)
flo_eql

Overrides:
eql_p in class RubyNumeric

hash

public RubyFixnum hash()
flo_hash

Overrides:
hash in class RubyObject

hashCode

public final int hashCode()
Overrides:
hashCode in class RubyObject

to_f

public IRubyObject to_f()
flo_fo


abs

public IRubyObject abs()
flo_abs

Overrides:
abs in class RubyNumeric

zero_p

public IRubyObject zero_p()
flo_zero_p

Overrides:
zero_p in class RubyNumeric

truncate

public IRubyObject truncate()
flo_truncate

Overrides:
truncate in class RubyNumeric

floor

public IRubyObject floor()
loor

Overrides:
floor in class RubyNumeric

ceil

public IRubyObject ceil()
flo_ceil

Overrides:
ceil in class RubyNumeric

round

public IRubyObject round()
flo_round

Overrides:
round in class RubyNumeric

nan_p

public IRubyObject nan_p()
flo_is_nan_p


infinite_p

public IRubyObject infinite_p()
flo_is_infinite_p


finite_p

public IRubyObject finite_p()
flo_is_finite_p


marshalTo

public static void marshalTo(RubyFloat aFloat,
                             MarshalStream output)
                      throws java.io.IOException
Throws:
java.io.IOException

unmarshalFrom

public static RubyFloat unmarshalFrom(UnmarshalStream input)
                               throws java.io.IOException
Throws:
java.io.IOException


Copyright © 2002-2007 JRuby Team. All Rights Reserved.