org.jruby
Class RubyRational

java.lang.Object
  extended by org.jruby.RubyBasicObject
      extended by org.jruby.RubyObject
          extended by org.jruby.RubyNumeric
              extended by org.jruby.RubyRational
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Comparable<IRubyObject>, InstanceVariables, InternalVariables, IRubyObject, CoreObjectType

public class RubyRational
extends RubyNumeric

1.9 rational.c as of revision: 20011

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class org.jruby.RubyNumeric
RubyNumeric.InvalidIntegerException, RubyNumeric.NumberTooLargeException
 
Nested classes/interfaces inherited from class org.jruby.RubyObject
RubyObject.Data, RubyObject.ObjectMethods
 
Nested classes/interfaces inherited from class org.jruby.RubyBasicObject
RubyBasicObject.BasicObjectMethods, RubyBasicObject.Finalizer
 
Field Summary
 
Fields inherited from class org.jruby.RubyNumeric
DBL_EPSILON, NUMERIC_ALLOCATOR
 
Fields inherited from class org.jruby.RubyObject
OBJECT_ALLOCATOR
 
Fields inherited from class org.jruby.RubyBasicObject
ALL_F, COMPARE_BY_IDENTITY_F, ERR_INSECURE_SET_INST_VAR, FALSE_F, FL_USHIFT, flags, FROZEN_F, metaClass, NEVER, NIL_F, TAINTED_F, UNDEF, UNTRUSTED_F, USER0_F, USER1_F, USER2_F, USER3_F, USER4_F, USER5_F, USER6_F, USER7_F
 
Fields inherited from interface org.jruby.runtime.builtin.IRubyObject
NULL_ARRAY
 
Method Summary
static IRubyObject convert(ThreadContext context, IRubyObject recv, IRubyObject a1)
          nurat_s_convert
static IRubyObject convert(ThreadContext context, IRubyObject clazz, IRubyObject[] args)
          Deprecated. 
static IRubyObject convert(ThreadContext context, IRubyObject recv, IRubyObject a1, IRubyObject a2)
          nurat_s_convert
static RubyClass createRationalClass(Ruby runtime)
           
 IRubyObject denominator(ThreadContext context)
          nurat_denominator
 IRubyObject hash(ThreadContext context)
          nurat_to_r
 IRubyObject inspect(ThreadContext context)
          nurat_inspect
 IRubyObject marshal_dump(ThreadContext context)
          nurat_marshal_dump
 IRubyObject marshal_load(ThreadContext context, IRubyObject arg)
          nurat_marshal_load
static IRubyObject newInstance(ThreadContext context, IRubyObject clazz, IRubyObject num)
           
static IRubyObject newInstance(ThreadContext context, IRubyObject clazz, IRubyObject[] args)
          Deprecated. 
static IRubyObject newInstance(ThreadContext context, IRubyObject clazz, IRubyObject num, IRubyObject den)
           
static IRubyObject newInstanceBang(ThreadContext context, IRubyObject recv, IRubyObject num)
           
static IRubyObject newInstanceBang(ThreadContext context, IRubyObject recv, IRubyObject[] args)
          Deprecated. 
static IRubyObject newInstanceBang(ThreadContext context, IRubyObject recv, IRubyObject num, IRubyObject den)
           
static IRubyObject newRationalConvert(ThreadContext context, IRubyObject x)
          rb_Rational1
static IRubyObject newRationalConvert(ThreadContext context, IRubyObject x, IRubyObject y)
          rb_Rational/rb_Rational2
 IRubyObject numerator(ThreadContext context)
          nurat_numerator
 IRubyObject op_abs(ThreadContext context)
          nurat_abs
 IRubyObject op_add(ThreadContext context, IRubyObject other)
          nurat_add
 IRubyObject op_ceil(ThreadContext context)
          nurat_ceil
 IRubyObject op_ceil(ThreadContext context, IRubyObject n)
           
 IRubyObject op_cmp(ThreadContext context, IRubyObject other)
          nurat_cmp
 IRubyObject op_coerce(ThreadContext context, IRubyObject other)
          nurat_coerce
 IRubyObject op_div(ThreadContext context, IRubyObject other)
          nurat_div
 IRubyObject op_divmod(ThreadContext context, IRubyObject other)
          nurat_divmod
 IRubyObject op_equal(ThreadContext context, IRubyObject other)
          nurat_equal_p
 IRubyObject op_expt(ThreadContext context, IRubyObject other)
          nurat_expt
 IRubyObject op_fdiv(ThreadContext context, IRubyObject other)
          nurat_fdiv
 IRubyObject op_floor(ThreadContext context)
          nurat_floor
 IRubyObject op_floor(ThreadContext context, IRubyObject n)
           
 IRubyObject op_idiv(ThreadContext context, IRubyObject other)
          nurat_idiv
 IRubyObject op_mod(ThreadContext context, IRubyObject other)
          nurat_mod
 IRubyObject op_mul(ThreadContext context, IRubyObject other)
          nurat_mul
 IRubyObject op_rem(ThreadContext context, IRubyObject other)
          nurat_rem
 IRubyObject op_round(ThreadContext context)
          nurat_round
 IRubyObject op_round(ThreadContext context, IRubyObject n)
           
 IRubyObject op_sub(ThreadContext context, IRubyObject other)
          nurat_sub
 IRubyObject op_truncate(ThreadContext context)
          nurat_truncate
 IRubyObject op_truncate(ThreadContext context, IRubyObject n)
           
 IRubyObject to_f(ThreadContext context)
           
 IRubyObject to_r(ThreadContext context)
          nurat_to_r
 IRubyObject to_s(ThreadContext context)
          nurat_to_s
 
Methods inherited from class org.jruby.RubyNumeric
abs, abs2, arg, asNumeric, callCoerced, callCoerced, ceil, checkInt, coerce, coerceBin, coerceBody, coerceCmp, coerceRelOp, conjugate, createNumericClass, dbl_cmp, dbl2num, div, divmod, doCoerce, eql_p, fdiv, fix2int, fix2int, fix2long, floatStep, floor, getBigIntegerValue, getCoerced, getDoubleValue, getLongValue, image, initialize_copy, int2fix, integer_p, magnitude, modulo, newNumeric, nonzero_p, num2chr, num2dbl, num2fix, num2int, num2long, op_cmp, op_num_equal, op_uminus, op_uplus, polar, quo_19, quo, real, rect, remainder, round, sadded, scalar_p, step, step, step, step19, step19, str2fnum, str2fnum, str2inum, str2inum, to_c, to_int, toJava, truncate, zero_p
 
Methods inherited from class org.jruby.RubyObject
as, attachToObjectSpace, callInit, checkFrozen, convertToType, createObjectClass, display, dup, eql_p, eqlInternal, equal_p, equalInternal, equals, evalUnder, evalUnder, extend, freeze, frozen_p, getNativeTypeIndex, hash, hashCode, id_deprecated, id, initialize, inspect, instance_eval, instance_eval, instance_eval, instance_eval, instance_eval, instance_exec, instance_of_p, instance_variable_defined_p, instance_variable_get, instance_variable_set, instance_variables, kind_of_p, method, methods, methods, methods19, nil_p, op_eqq, op_match, op_not_match, private_methods, private_methods19, protected_methods, protected_methods19, public_methods, public_methods19, puts, rbClone, remove_instance_variable, respond_to_p, respond_to_p, send, send, send, send, send, singleton_methods, singleton_methods19, singletonMethods, specificEval, specificEval, specificEval, specificEval, specificEval, taint, tainted_p, to_a, to_java, to_s, toString, trust, type_deprecated, type, untaint, untrust, untrusted_p, validateInstanceVariable
 
Methods inherited from class org.jruby.RubyBasicObject
addFinalizer, anyToString, asJavaString, asString, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callSuper, checkArrayType, checkStringType, compareTo, convertToArray, convertToFloat, convertToHash, convertToInteger, convertToInteger, convertToInteger, convertToString, copyInstanceVariablesInto, copySpecialInstanceVariables, createBasicObjectClass, dataGetStruct, dataGetStructChecked, dataWrapStruct, ensureInstanceVariablesSettable, eql, fastGetInstanceVariable, fastGetInternalVariable, fastHasInstanceVariable, fastHasInternalVariable, fastSetInstanceVariable, fastSetInternalVariable, getFlag, getInstanceVariable, getInstanceVariableList, getInstanceVariableNameList, getInstanceVariables, getInternalVariable, getInternalVariables, getJavaClass, getMetaClass, getRuntime, getSingletonClass, getSingletonClassClone, getType, getVariable, getVariableCount, getVariableList, getVariableNameList, hasInstanceVariable, hasInternalVariable, hasVariables, infectBy, isClass, isFalse, isFrozen, isImmediate, isModule, isNil, isTaint, isTrue, isUntrusted, makeMetaClass, op_not_equal, op_not, removeFinalizers, removeInstanceVariable, removeInternalVariable, respondsTo, setFlag, setFrozen, setInstanceVariable, setInternalVariable, setMetaClass, setTaint, setUntrusted, setVariable, syncVariables, taint, testFrozen, testFrozen, variableTableContains, variableTableFastContains, variableTableFastFetch, variableTableFastStore, variableTableFetch, variableTableGetSize, variableTableRemove, variableTableStore, variableTableSync
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

createRationalClass

public static RubyClass createRationalClass(Ruby runtime)

newInstanceBang

@Deprecated
public static IRubyObject newInstanceBang(ThreadContext context,
                                                     IRubyObject recv,
                                                     IRubyObject[] args)
Deprecated. 

nurat_s_new_bang


newInstanceBang

public static IRubyObject newInstanceBang(ThreadContext context,
                                          IRubyObject recv,
                                          IRubyObject num)

newInstanceBang

public static IRubyObject newInstanceBang(ThreadContext context,
                                          IRubyObject recv,
                                          IRubyObject num,
                                          IRubyObject den)

newInstance

@Deprecated
public static IRubyObject newInstance(ThreadContext context,
                                                 IRubyObject clazz,
                                                 IRubyObject[] args)
Deprecated. 

nurat_s_new


newInstance

public static IRubyObject newInstance(ThreadContext context,
                                      IRubyObject clazz,
                                      IRubyObject num)

newInstance

public static IRubyObject newInstance(ThreadContext context,
                                      IRubyObject clazz,
                                      IRubyObject num,
                                      IRubyObject den)

newRationalConvert

public static IRubyObject newRationalConvert(ThreadContext context,
                                             IRubyObject x)
rb_Rational1


newRationalConvert

public static IRubyObject newRationalConvert(ThreadContext context,
                                             IRubyObject x,
                                             IRubyObject y)
rb_Rational/rb_Rational2


convert

@Deprecated
public static IRubyObject convert(ThreadContext context,
                                             IRubyObject clazz,
                                             IRubyObject[] args)
Deprecated. 


convert

public static IRubyObject convert(ThreadContext context,
                                  IRubyObject recv,
                                  IRubyObject a1)
nurat_s_convert


convert

public static IRubyObject convert(ThreadContext context,
                                  IRubyObject recv,
                                  IRubyObject a1,
                                  IRubyObject a2)
nurat_s_convert


numerator

public IRubyObject numerator(ThreadContext context)
nurat_numerator

Overrides:
numerator in class RubyNumeric

denominator

public IRubyObject denominator(ThreadContext context)
nurat_denominator

Overrides:
denominator in class RubyNumeric

op_add

public IRubyObject op_add(ThreadContext context,
                          IRubyObject other)
nurat_add


op_sub

public IRubyObject op_sub(ThreadContext context,
                          IRubyObject other)
nurat_sub


op_mul

public IRubyObject op_mul(ThreadContext context,
                          IRubyObject other)
nurat_mul


op_div

public IRubyObject op_div(ThreadContext context,
                          IRubyObject other)
nurat_div


op_fdiv

public IRubyObject op_fdiv(ThreadContext context,
                           IRubyObject other)
nurat_fdiv


op_expt

public IRubyObject op_expt(ThreadContext context,
                           IRubyObject other)
nurat_expt


op_cmp

public IRubyObject op_cmp(ThreadContext context,
                          IRubyObject other)
nurat_cmp


op_equal

public IRubyObject op_equal(ThreadContext context,
                            IRubyObject other)
nurat_equal_p

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

op_coerce

public IRubyObject op_coerce(ThreadContext context,
                             IRubyObject other)
nurat_coerce


op_idiv

public IRubyObject op_idiv(ThreadContext context,
                           IRubyObject other)
nurat_idiv


op_mod

public IRubyObject op_mod(ThreadContext context,
                          IRubyObject other)
nurat_mod


op_divmod

public IRubyObject op_divmod(ThreadContext context,
                             IRubyObject other)
nurat_divmod


op_rem

public IRubyObject op_rem(ThreadContext context,
                          IRubyObject other)
nurat_rem


op_abs

public IRubyObject op_abs(ThreadContext context)
nurat_abs


op_floor

public IRubyObject op_floor(ThreadContext context)
nurat_floor


op_floor

public IRubyObject op_floor(ThreadContext context,
                            IRubyObject n)

op_ceil

public IRubyObject op_ceil(ThreadContext context)
nurat_ceil


op_ceil

public IRubyObject op_ceil(ThreadContext context,
                           IRubyObject n)

op_truncate

public IRubyObject op_truncate(ThreadContext context)
nurat_truncate


op_truncate

public IRubyObject op_truncate(ThreadContext context,
                               IRubyObject n)

op_round

public IRubyObject op_round(ThreadContext context)
nurat_round


op_round

public IRubyObject op_round(ThreadContext context,
                            IRubyObject n)

to_f

public IRubyObject to_f(ThreadContext context)

to_r

public IRubyObject to_r(ThreadContext context)
nurat_to_r


hash

public IRubyObject hash(ThreadContext context)
nurat_to_r


to_s

public IRubyObject to_s(ThreadContext context)
nurat_to_s


inspect

public IRubyObject inspect(ThreadContext context)
nurat_inspect


marshal_dump

public IRubyObject marshal_dump(ThreadContext context)
nurat_marshal_dump


marshal_load

public IRubyObject marshal_load(ThreadContext context,
                                IRubyObject arg)
nurat_marshal_load



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