Logo Search packages:      
Sourcecode: jruby version File versions  Download package

Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Static Protected Attributes | Package Functions | Static Package Functions | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes

org::jruby::RubyRational Class Reference

Inheritance diagram for org::jruby::RubyRational:
Inheritance graph
[legend]
Collaboration diagram for org::jruby::RubyRational:
Collaboration graph
[legend]

List of all members.

Public Member Functions

IRubyObject abs (ThreadContext context)
IRubyObject abs2 (ThreadContext context)
void addFinalizer (IRubyObject f)
IRubyObject anyToString ()
IRubyObject arg (ThreadContext context)
String asJavaString ()
RubyNumeric asNumeric ()
RubyString asString ()
void attachToObjectSpace ()
final void callInit (IRubyObject[] args, Block block)
final IRubyObject callMethod (ThreadContext context, String name)
final IRubyObject callMethod (ThreadContext context, String name, IRubyObject arg)
final IRubyObject callMethod (ThreadContext context, String name, IRubyObject[] args)
final IRubyObject callMethod (String name, IRubyObject...args)
final IRubyObject callMethod (String name)
final IRubyObject callMethod (ThreadContext context, String name, IRubyObject[] args, Block block)
final IRubyObject callMethod (ThreadContext context, int methodIndex, String name)
final IRubyObject callMethod (ThreadContext context, int methodIndex, String name, IRubyObject arg)
IRubyObject callSuper (ThreadContext context, IRubyObject[] args, Block block)
IRubyObject ceil ()
IRubyObject checkArrayType ()
final IRubyObject checkCallMethod (ThreadContext context, String name)
IRubyObject checkStringType ()
IRubyObject checkStringType19 ()
IRubyObject coerce (IRubyObject other)
int compareTo (IRubyObject other)
IRubyObject conjugate (ThreadContext context)
RubyArray convertToArray ()
RubyFloat convertToFloat ()
RubyHash convertToHash ()
RubyInteger convertToInteger ()
RubyInteger convertToInteger (int methodIndex, String convertMethod)
RubyInteger convertToInteger (String convertMethod)
RubyString convertToString ()
final IRubyObject convertToType (RubyClass target, int convertMethodIndex)
void copyInstanceVariablesInto (final InstanceVariables other)
void copyInstanceVariablesInto (InstanceVariables other)
void copySpecialInstanceVariables (IRubyObject clone)
synchronized Object dataGetStruct ()
synchronized Object dataGetStructChecked ()
synchronized void dataWrapStruct (Object obj)
IRubyObject denominator (ThreadContext context)
IRubyObject display (ThreadContext context, IRubyObject[] args)
IRubyObject div (ThreadContext context, IRubyObject other)
IRubyObject divmod (ThreadContext context, IRubyObject other)
IRubyObject dup ()
boolean eql (IRubyObject other)
IRubyObject eql_p (ThreadContext context, IRubyObject other)
IRubyObject eql_p (IRubyObject obj)
IRubyObject equal_p (ThreadContext context, IRubyObject obj)
IRubyObject equal_p19 (ThreadContext context, IRubyObject other)
boolean equals (Object other)
IRubyObject evalUnder (final ThreadContext context, RubyModule under, RubyString src, String file, int line)
IRubyObject evalUnder (final ThreadContext context, RubyModule under, IRubyObject src, IRubyObject file, IRubyObject line)
IRubyObject extend (IRubyObject[] args)
IRubyObject fastGetInstanceVariable (String internedName)
Object fastGetInternalVariable (String internedName)
boolean fastHasInstanceVariable (String internedName)
boolean fastHasInternalVariable (String internedName)
IRubyObject fastSetInstanceVariable (String internedName, IRubyObject value)
void fastSetInternalVariable (String internedName, Object value)
IRubyObject fdiv (ThreadContext context, IRubyObject other)
IRubyObject floor ()
IRubyObject freeze (ThreadContext context)
RubyBoolean frozen_p (ThreadContext context)
BigInteger getBigIntegerValue ()
double getDoubleValue ()
final boolean getFlag (int flag)
IRubyObject getInstanceVariable (String name)
List< Variable< IRubyObject > > getInstanceVariableList ()
List< String > getInstanceVariableNameList ()
InstanceVariables getInstanceVariables ()
Object getInternalVariable (String name)
InternalVariables getInternalVariables ()
Class getJavaClass ()
long getLongValue ()
final RubyClass getMetaClass ()
int getNativeTypeIndex ()
final Ruby getRuntime ()
RubyClass getSingletonClass ()
RubyClass getType ()
Object getVariable (int index)
int getVariableCount ()
List< Variable< Object > > getVariableList ()
List< String > getVariableNameList ()
IRubyObject hash (ThreadContext context)
RubyFixnum hash ()
int hashCode ()
IRubyObject hashyInspect ()
boolean hasInstanceVariable (String name)
boolean hasInternalVariable (String name)
boolean hasVariables ()
IRubyObject id ()
IRubyObject id_deprecated ()
IRubyObject image (ThreadContext context)
IRubyObject infectBy (IRubyObject obj)
IRubyObject initialize ()
IRubyObject initialize_copy (IRubyObject arg)
IRubyObject inspect (ThreadContext context)
IRubyObject inspect ()
IRubyObject instance_eval (ThreadContext context, Block block)
IRubyObject instance_eval (ThreadContext context, IRubyObject arg0, Block block)
IRubyObject instance_eval (ThreadContext context, IRubyObject arg0, IRubyObject arg1, Block block)
IRubyObject instance_eval (ThreadContext context, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, Block block)
IRubyObject instance_eval (ThreadContext context, IRubyObject[] args, Block block)
IRubyObject instance_exec (ThreadContext context, IRubyObject[] args, Block block)
RubyBoolean instance_of_p (ThreadContext context, IRubyObject type)
IRubyObject instance_variable_defined_p (ThreadContext context, IRubyObject name)
IRubyObject instance_variable_get (ThreadContext context, IRubyObject name)
IRubyObject instance_variable_set (IRubyObject name, IRubyObject value)
RubyArray instance_variables (ThreadContext context)
IRubyObject integer_p ()
boolean isBuiltin (String methodName)
boolean isClass ()
final boolean isFalse ()
boolean isFrozen ()
boolean isImmediate ()
boolean isModule ()
final boolean isNil ()
boolean isTaint ()
final boolean isTrue ()
boolean isUntrusted ()
RubyBoolean kind_of_p (ThreadContext context, IRubyObject type)
IRubyObject magnitude (ThreadContext context)
RubyClass makeMetaClass (RubyClass superClass)
IRubyObject marshal_dump (ThreadContext context)
IRubyObject marshal_load (ThreadContext context, IRubyObject arg)
IRubyObject method (IRubyObject symbol)
IRubyObject methods (ThreadContext context, IRubyObject[] args)
IRubyObject methods (ThreadContext context, IRubyObject[] args, boolean useSymbols)
IRubyObject methods19 (ThreadContext context, IRubyObject[] args)
IRubyObject modulo (ThreadContext context, IRubyObject other)
IRubyObject nil_p (ThreadContext context)
IRubyObject nonzero_p (ThreadContext context)
IRubyObject num_imaginary (ThreadContext context)
IRubyObject numerator (ThreadContext context)
IRubyObject op_abs (ThreadContext context)
IRubyObject op_add (ThreadContext context, IRubyObject other)
IRubyObject op_ceil (ThreadContext context, IRubyObject n)
IRubyObject op_ceil (ThreadContext context)
IRubyObject op_cmp (ThreadContext context, IRubyObject other)
IRubyObject op_cmp (IRubyObject other)
IRubyObject op_coerce (ThreadContext context, IRubyObject other)
IRubyObject op_div (ThreadContext context, IRubyObject other)
IRubyObject op_divmod (ThreadContext context, IRubyObject other)
IRubyObject op_divmod19 (ThreadContext context, IRubyObject other)
IRubyObject op_eqq (ThreadContext context, IRubyObject other)
IRubyObject op_equal (ThreadContext context, IRubyObject other)
IRubyObject op_equal_19 (ThreadContext context, IRubyObject obj)
IRubyObject op_expt (ThreadContext context, IRubyObject other)
IRubyObject op_fdiv (ThreadContext context, IRubyObject other)
IRubyObject op_floor (ThreadContext context)
IRubyObject op_floor (ThreadContext context, IRubyObject n)
IRubyObject op_idiv (ThreadContext context, IRubyObject other)
IRubyObject op_idiv19 (ThreadContext context, IRubyObject other)
IRubyObject op_match (ThreadContext context, IRubyObject arg)
IRubyObject op_mod (ThreadContext context, IRubyObject other)
IRubyObject op_mod19 (ThreadContext context, IRubyObject other)
IRubyObject op_mul (ThreadContext context, IRubyObject other)
IRubyObject op_not (ThreadContext context)
IRubyObject op_not_equal (ThreadContext context, IRubyObject other)
IRubyObject op_not_match (ThreadContext context, IRubyObject arg)
IRubyObject op_rem (ThreadContext context, IRubyObject other)
IRubyObject op_round (ThreadContext context, IRubyObject n)
IRubyObject op_round (ThreadContext context)
IRubyObject op_sub (ThreadContext context, IRubyObject other)
IRubyObject op_truncate (ThreadContext context, IRubyObject n)
IRubyObject op_truncate (ThreadContext context)
IRubyObject op_uminus (ThreadContext context)
IRubyObject op_uplus ()
IRubyObject polar (ThreadContext context)
IRubyObject private_methods (ThreadContext context, IRubyObject[] args)
IRubyObject private_methods19 (ThreadContext context, IRubyObject[] args)
IRubyObject protected_methods (ThreadContext context, IRubyObject[] args)
IRubyObject protected_methods19 (ThreadContext context, IRubyObject[] args)
IRubyObject public_methods (ThreadContext context, IRubyObject[] args)
IRubyObject public_methods19 (ThreadContext context, IRubyObject[] args)
IRubyObject quo (ThreadContext context, IRubyObject other)
IRubyObject quo_19 (ThreadContext context, IRubyObject other)
IRubyObject rationalize (ThreadContext context, IRubyObject[] args)
IRubyObject rbClone ()
IRubyObject real (ThreadContext context)
IRubyObject rect (ThreadContext context)
IRubyObject remainder (ThreadContext context, IRubyObject dividend)
IRubyObject remove_instance_variable (ThreadContext context, IRubyObject name, Block block)
void removeFinalizers ()
IRubyObject removeInstanceVariable (String name)
Object removeInternalVariable (String name)
RubyBoolean respond_to_p (IRubyObject mname, IRubyObject includePrivate)
RubyBoolean respond_to_p (IRubyObject mname)
final boolean respondsTo (String name)
IRubyObject round ()
IRubyObject sadded (IRubyObject name)
IRubyObject scalar_p ()
IRubyObject send (ThreadContext context, IRubyObject arg0, IRubyObject arg1, Block block)
IRubyObject send (ThreadContext context, Block block)
IRubyObject send (ThreadContext context, IRubyObject arg0, Block block)
IRubyObject send (ThreadContext context, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, Block block)
IRubyObject send (ThreadContext context, IRubyObject[] args, Block block)
final void setFlag (int flag, boolean set)
void setFrozen (boolean frozen)
IRubyObject setInstanceVariable (String name, IRubyObject value)
void setInternalVariable (String name, Object value)
void setMetaClass (RubyClass metaClass)
void setTaint (boolean taint)
void setUntrusted (boolean untrusted)
synchronized void setVariable (int index, Object value)
RubyArray singleton_methods (ThreadContext context, IRubyObject[] args)
RubyArray singleton_methods19 (ThreadContext context, IRubyObject[] args)
RubyArray singletonMethods (ThreadContext context, IRubyObject[] args, boolean asSymbols)
IRubyObject specificEval (ThreadContext context, RubyModule mod, IRubyObject[] args, Block block)
IRubyObject specificEval (ThreadContext context, RubyModule mod, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, Block block)
IRubyObject specificEval (ThreadContext context, RubyModule mod, IRubyObject arg0, IRubyObject arg1, Block block)
IRubyObject specificEval (ThreadContext context, RubyModule mod, Block block)
IRubyObject specificEval (ThreadContext context, RubyModule mod, IRubyObject arg, Block block)
IRubyObject step (ThreadContext context, IRubyObject[] args, Block block)
IRubyObject step (ThreadContext context, IRubyObject to, IRubyObject step, Block block)
IRubyObject step (ThreadContext context, IRubyObject arg0, Block block)
IRubyObject step19 (ThreadContext context, IRubyObject arg0, Block block)
IRubyObject step19 (ThreadContext context, IRubyObject to, IRubyObject step, Block block)
void syncVariables (List< Variable< Object >> variables)
IRubyObject taint (ThreadContext context)
RubyBoolean tainted_p (ThreadContext context)
RubyArray to_a ()
IRubyObject to_c (ThreadContext context)
IRubyObject to_f (ThreadContext context)
IRubyObject to_int (ThreadContext context)
IRubyObject to_r (ThreadContext context)
IRubyObject to_s (ThreadContext context)
IRubyObject to_s ()
Object toJava (Class target)
String toString ()
IRubyObject truncate ()
IRubyObject trust (ThreadContext context)
RubyClass type ()
RubyClass type_deprecated ()
IRubyObject untaint (ThreadContext context)
IRubyObject untrust (ThreadContext context)
RubyBoolean untrusted_p (ThreadContext context)
IRubyObject zero_p (ThreadContext context)

Static Public Member Functions

static void checkInt (IRubyObject arg, long num)
static IRubyObject convert (ThreadContext context, IRubyObject clazz, IRubyObject[]args)
static IRubyObject convert (ThreadContext context, IRubyObject recv, IRubyObject a1)
static IRubyObject convert (ThreadContext context, IRubyObject recv, IRubyObject a1, IRubyObject a2)
static RubyClass createBasicObjectClass (Ruby runtime, RubyClass objectClass)
static RubyClass createNumericClass (Ruby runtime)
static RubyClass createObjectClass (Ruby runtime, RubyClass objectClass)
static RubyClass createRationalClass (Ruby runtime)
static IRubyObject dbl2num (Ruby runtime, double val)
static IRubyObject dbl_cmp (Ruby runtime, double a, double b)
static int fix2int (IRubyObject arg)
static int fix2int (RubyFixnum arg)
static long fix2long (IRubyObject arg)
static RubyNumeric int2fix (Ruby runtime, long val)
static IRubyObject newInstance (ThreadContext context, IRubyObject clazz, IRubyObject num, IRubyObject den)
static IRubyObject newInstance (ThreadContext context, IRubyObject clazz, IRubyObject[]args)
static IRubyObject newInstance (ThreadContext context, IRubyObject clazz, IRubyObject num)
static IRubyObject newInstanceBang (ThreadContext context, IRubyObject recv, IRubyObject[]args)
static IRubyObject newInstanceBang (ThreadContext context, IRubyObject recv, IRubyObject num, IRubyObject den)
static IRubyObject newInstanceBang (ThreadContext context, IRubyObject recv, IRubyObject num)
static RubyNumeric newNumeric (Ruby runtime)
static IRubyObject newRationalConvert (ThreadContext context, IRubyObject x)
static IRubyObject newRationalConvert (ThreadContext context, IRubyObject x, IRubyObject y)
static byte num2chr (IRubyObject arg)
static double num2dbl (IRubyObject arg)
static IRubyObject num2fix (IRubyObject val)
static int num2int (IRubyObject arg)
static long num2long (IRubyObject arg)
static void puts (Object obj)
static void setCanonicalization (boolean canonical)
static RubyFloat str2fnum (Ruby runtime, RubyString arg, boolean strict)
static RubyFloat str2fnum (Ruby runtime, RubyString arg)
static RubyFloat str2fnum19 (Ruby runtime, RubyString arg, boolean strict)
static RubyInteger str2inum (Ruby runtime, RubyString str, int base)
static RubyInteger str2inum (Ruby runtime, RubyString str, int base, boolean strict)

Static Public Attributes

static final int ALL_F = -1
static final int COMPARE_BY_IDENTITY_F = (1<<(FL_USHIFT+8))
static final double DBL_EPSILON = 2.2204460492503131e-16
static final int FALSE_F = 1 << 0
static final int FL_USHIFT = 5
static final int FROZEN_F = 1 << 2
static final IRubyObject NEVER = new RubyBasicObject()
static final int NIL_F = 1 << 1
static final IRubyObject[] NULL_ARRAY = new IRubyObject[0]
static final ObjectAllocator OBJECT_ALLOCATOR
static final int TAINTED_F = 1 << 3
static final IRubyObject UNDEF = new RubyBasicObject()
static final int UNTRUSTED_F = 1 << 4
static final int USER0_F = (1<<(FL_USHIFT+0))
static final int USER1_F = (1<<(FL_USHIFT+1))
static final int USER2_F = (1<<(FL_USHIFT+2))
static final int USER3_F = (1<<(FL_USHIFT+3))
static final int USER4_F = (1<<(FL_USHIFT+4))
static final int USER5_F = (1<<(FL_USHIFT+5))
static final int USER6_F = (1<<(FL_USHIFT+6))
static final int USER7_F = (1<<(FL_USHIFT+7))

Protected Member Functions

IRubyObject callCoerced (ThreadContext context, String method, IRubyObject other, boolean err)
IRubyObject callCoerced (ThreadContext context, String method, IRubyObject other)
void checkFrozen ()
final IRubyObject coerceBin (ThreadContext context, String method, IRubyObject other)
final IRubyObject coerceBody (ThreadContext context, IRubyObject other)
final IRubyObject coerceCmp (ThreadContext context, String method, IRubyObject other)
final IRubyObject coerceRelOp (ThreadContext context, String method, IRubyObject other)
final RubyArray doCoerce (ThreadContext context, IRubyObject other, boolean err)
final void ensureInstanceVariablesSettable ()
IRubyObject[] getCoerced (ThreadContext context, IRubyObject other, boolean error)
synchronized long getObjectId ()
RubyClass getSingletonClassClone ()
synchronized long initObjectId (RubyClass.VariableAccessor objectIdAccessor)
int inspectHashCode ()
final IRubyObject op_num_equal (ThreadContext context, IRubyObject other)
void taint (Ruby runtime)
final void testFrozen (String message)
final void testFrozen ()
String validateInstanceVariable (String name)
boolean variableTableContains (String name)
boolean variableTableFastContains (String internedName)
Object variableTableFastFetch (String internedName)
Object variableTableFastStore (String internedName, Object value)
Object variableTableFetch (String name)
Object variableTableRemove (String name)
Object variableTableStore (String name, Object value)
void variableTableSync (List< Variable< Object >> vars)

Static Protected Member Functions

static boolean eqlInternal (final ThreadContext context, final IRubyObject that, final IRubyObject other)
static boolean equalInternal (final ThreadContext context, final IRubyObject that, final IRubyObject other)
static void floatStep (ThreadContext context, Ruby runtime, IRubyObject from, IRubyObject to, IRubyObject step, Block block)

Protected Attributes

int flags
transient RubyClass metaClass

Static Protected Attributes

static final String ERR_INSECURE_SET_INST_VAR = "Insecure: can't modify instance variable"
static final ObjectAllocator NUMERIC_ALLOCATOR

Package Functions

IRubyObject checkIntegerType (Ruby runtime, IRubyObject obj, String method)
final RubyBasicObject infectBy (RubyBasicObject obj)
final RubyBasicObject infectBy (int tuFlags)

Static Package Functions

static void floatStep19 (ThreadContext context, Ruby runtime, IRubyObject from, IRubyObject to, IRubyObject step, boolean excl, Block block)
static RubyString inspect (ThreadContext context, IRubyObject object)
static void intCheck (ThreadContext context, IRubyObject num)
static IRubyObject intValue (ThreadContext context, IRubyObject num)
static IRubyObject newRationalCanonicalize (ThreadContext context, IRubyObject x)
static RubyRational newRationalRaw (Ruby runtime, IRubyObject x)
static RubyRational newRationalRaw (Ruby runtime, IRubyObject x, IRubyObject y)
static RubyArray str_to_r_internal (ThreadContext context, IRubyObject recv)

Private Member Functions

IRubyObject f_addsub (ThreadContext context, IRubyObject anum, IRubyObject aden, IRubyObject bnum, IRubyObject bden, boolean plus)
IRubyObject f_muldiv (ThreadContext context, IRubyObject anum, IRubyObject aden, IRubyObject bnum, IRubyObject bden, boolean mult)
IRubyObject op_roundCommonPost (ThreadContext context, IRubyObject s, IRubyObject n, IRubyObject b)
IRubyObject op_roundCommonPre (ThreadContext context, IRubyObject n)
 RubyRational (Ruby runtime, IRubyObject clazz, IRubyObject num, IRubyObject den)

Static Private Member Functions

static IRubyObject canonicalizeInternal (ThreadContext context, IRubyObject clazz, IRubyObject num, IRubyObject den)
static IRubyObject canonicalizeInternalNoReduce (ThreadContext context, IRubyObject clazz, IRubyObject num, IRubyObject den)
static IRubyObject convertCommon (ThreadContext context, IRubyObject recv, IRubyObject a1, IRubyObject a2)
static IRubyObject f_imul (ThreadContext context, long a, long b)
static IRubyObject newRational (ThreadContext context, IRubyObject clazz, IRubyObject x, IRubyObject y)
static IRubyObject newRational (ThreadContext context, IRubyObject clazz, IRubyObject x)
static RubyRational newRationalBang (ThreadContext context, IRubyObject clazz, IRubyObject x)
static RubyRational newRationalBang (ThreadContext context, IRubyObject clazz, IRubyObject x, IRubyObject y)
static IRubyObject newRationalCanonicalize (ThreadContext context, IRubyObject x, IRubyObject y)
static IRubyObject newRationalNoReduce (ThreadContext context, IRubyObject clazz, IRubyObject x, IRubyObject y)
static IRubyObject newRationalNoReduce (ThreadContext context, IRubyObject clazz, IRubyObject x)
static IRubyObject str_to_r_strict (ThreadContext context, IRubyObject recv)

Private Attributes

IRubyObject den
IRubyObject num

Static Private Attributes

static boolean canonicalization = false
static long ML = (long)(Math.log(Double.MAX_VALUE) / Math.log(2.0) - 1)
static ObjectAllocator RATIONAL_ALLOCATOR

Detailed Description

1.9 rational.c as of revision: 20011

Definition at line 79 of file RubyRational.java.


The documentation for this class was generated from the following file:

Generated by  Doxygen 1.6.0   Back to index