org.jruby
Class RubyBignum

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

public class RubyBignum
extends RubyInteger

Author:
jpetersen
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
 
Constructor Summary
RubyBignum(Ruby runtime, java.math.BigInteger value)
           
 
Method Summary
 IRubyObject abs()
          rb_big_abs
static double big2dbl(RubyBignum value)
          rb_big2dbl
static long big2long(RubyBignum value)
          rb_big2long
static RubyInteger bignorm(Ruby runtime, java.math.BigInteger bi)
          rb_big_norm
 IRubyObject coerce(IRubyObject other)
          rb_big_coerce
 int compareTo(IRubyObject other)
           
static RubyClass createBignumClass(Ruby runtime)
           
 IRubyObject divmod(ThreadContext context, IRubyObject other)
          rb_big_divmod
 IRubyObject divmod19(ThreadContext context, IRubyObject other)
           
 IRubyObject eql_p(IRubyObject other)
          rb_big_eql
static java.math.BigInteger fix2big(RubyFixnum arg)
          rb_int2big
 java.math.BigInteger getBigIntegerValue()
           
 double getDoubleValue()
           
 java.lang.Class<?> getJavaClass()
          Will return the Java interface that most closely can represent this object, when working through JAva integration translations.
 long getLongValue()
           
 int getNativeTypeIndex()
          This is overridden in the other concrete Java builtins to provide a fast way to determine what type they are.
 java.math.BigInteger getValue()
          Getter for property value.
 RubyFixnum hash()
          rb_big_hash
static java.math.BigInteger long2big(long arg)
           
static void marshalTo(RubyBignum bignum, MarshalStream output)
           
static RubyBignum newBignum(Ruby runtime, java.math.BigInteger value)
           
static RubyBignum newBignum(Ruby runtime, double value)
           
static RubyBignum newBignum(Ruby runtime, long value)
           
static RubyBignum newBignum(Ruby runtime, java.lang.String value)
           
 IRubyObject op_and(ThreadContext context, IRubyObject other)
          rb_big_and
 IRubyObject op_and19(ThreadContext context, IRubyObject other)
           
 RubyFixnum op_aref(IRubyObject other)
          rb_big_aref
 IRubyObject op_cmp(ThreadContext context, IRubyObject other)
          rb_big_cmp
 IRubyObject op_div(ThreadContext context, IRubyObject other)
          rb_big_div
 IRubyObject op_equal(IRubyObject other)
          rb_big_eq
 IRubyObject op_idiv(ThreadContext context, IRubyObject other)
          rb_big_idiv
 IRubyObject op_lshift(IRubyObject other)
          rb_big_lshift
 IRubyObject op_minus(ThreadContext context, IRubyObject other)
          rb_big_minus
 IRubyObject op_minus(ThreadContext context, long other)
           
 IRubyObject op_mod(ThreadContext context, IRubyObject other)
          rb_big_modulo
 IRubyObject op_mul(ThreadContext context, IRubyObject other)
          rb_big_mul
 IRubyObject op_mul(ThreadContext context, long other)
           
 IRubyObject op_neg()
          rb_big_neg
 IRubyObject op_or(ThreadContext context, IRubyObject other)
          rb_big_or
 IRubyObject op_or19(ThreadContext context, IRubyObject other)
           
 IRubyObject op_plus(ThreadContext context, IRubyObject other)
          rb_big_plus
 IRubyObject op_plus(ThreadContext context, long other)
           
 IRubyObject op_pow(ThreadContext context, IRubyObject other)
          rb_big_pow
 IRubyObject op_pow19(ThreadContext context, IRubyObject other)
          rb_big_pow
 IRubyObject op_rshift(IRubyObject other)
          rb_big_rshift
 IRubyObject op_uminus()
          rb_big_uminus
 IRubyObject op_xor(ThreadContext context, IRubyObject other)
          rb_big_xor
 IRubyObject op_xor19(ThreadContext context, IRubyObject other)
           
 IRubyObject quo(ThreadContext context, IRubyObject other)
          rb_big_quo
 IRubyObject quo19(ThreadContext context, IRubyObject other)
           
 IRubyObject remainder(ThreadContext context, IRubyObject other)
          rb_big_remainder
 IRubyObject remainder19(ThreadContext context, IRubyObject other)
           
 IRubyObject size()
          rb_big_size
 IRubyObject to_f()
          rb_big_to_f
 IRubyObject to_s(IRubyObject[] args)
          rb_big_to_s
static RubyNumeric unmarshalFrom(UnmarshalStream input)
           
 
Methods inherited from class org.jruby.RubyInteger
chr, chr19, chr19, convertToInteger, createIntegerClass, denominator, downto, downto19, even_p, gcd, gcdlcm, induced_from, integer_p, lcm, numerator, odd_p, ord, pred, round, round19, round19, succ, times, times19, to_i, to_r, toFloat, upto, upto19
 
Methods inherited from class org.jruby.RubyNumeric
abs, abs2, arg, asNumeric, callCoerced, callCoerced, ceil, checkInt, coerceBin, coerceBody, coerceCmp, coerceRelOp, conjugate, createNumericClass, dbl_cmp, dbl2num, div, doCoerce, eql_p, fdiv, fix2int, fix2int, fix2long, floatStep, floor, getCoerced, image, initialize_copy, int2fix, magnitude, modulo, newNumeric, nonzero_p, num2chr, num2dbl, num2fix, num2int, num2long, op_cmp, op_num_equal, op_uminus, op_uplus, polar, quo_19, real, rect, 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, eqlInternal, equal_p, equalInternal, equals, evalUnder, evalUnder, extend, freeze, frozen_p, 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_equal, 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, convertToArray, convertToFloat, convertToHash, convertToInteger, convertToInteger, convertToString, copyInstanceVariablesInto, copySpecialInstanceVariables, createBasicObjectClass, dataGetStruct, dataGetStructChecked, dataWrapStruct, ensureInstanceVariablesSettable, eql, fastGetInstanceVariable, fastGetInternalVariable, fastHasInstanceVariable, fastHasInternalVariable, fastSetInstanceVariable, fastSetInternalVariable, getFlag, getInstanceVariable, getInstanceVariableList, getInstanceVariableNameList, getInstanceVariables, getInternalVariable, getInternalVariables, 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
 

Constructor Detail

RubyBignum

public RubyBignum(Ruby runtime,
                  java.math.BigInteger value)
Method Detail

createBignumClass

public static RubyClass createBignumClass(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. Will generally return a value from org.jruby.runtime.ClassIndex

Specified by:
getNativeTypeIndex in interface CoreObjectType
Overrides:
getNativeTypeIndex in class RubyObject
Returns:
the ClassIndex of the native type this object was constructed from
See Also:
org.jruby.runtime.ClassInde

getJavaClass

public java.lang.Class<?> getJavaClass()
Description copied from class: RubyBasicObject
Will return the Java interface that most closely can represent this object, when working through JAva integration translations.

Specified by:
getJavaClass in interface IRubyObject
Overrides:
getJavaClass in class RubyBasicObject
Returns:
Class

newBignum

public static RubyBignum newBignum(Ruby runtime,
                                   long value)

newBignum

public static RubyBignum newBignum(Ruby runtime,
                                   double value)

newBignum

public static RubyBignum newBignum(Ruby runtime,
                                   java.math.BigInteger value)

newBignum

public static RubyBignum newBignum(Ruby runtime,
                                   java.lang.String value)

getDoubleValue

public double getDoubleValue()
Overrides:
getDoubleValue in class RubyNumeric

getLongValue

public long getLongValue()
Overrides:
getLongValue in class RubyNumeric

getBigIntegerValue

public java.math.BigInteger getBigIntegerValue()
Overrides:
getBigIntegerValue in class RubyNumeric

getValue

public java.math.BigInteger getValue()
Getter for property value.

Returns:
Value of property value.

bignorm

public static RubyInteger bignorm(Ruby runtime,
                                  java.math.BigInteger bi)
rb_big_norm


big2long

public static long big2long(RubyBignum value)
rb_big2long


big2dbl

public static double big2dbl(RubyBignum value)
rb_big2dbl


fix2big

public static java.math.BigInteger fix2big(RubyFixnum arg)
rb_int2big


long2big

public static java.math.BigInteger long2big(long arg)

to_s

public IRubyObject to_s(IRubyObject[] args)
rb_big_to_s


coerce

public IRubyObject coerce(IRubyObject other)
rb_big_coerce

Overrides:
coerce in class RubyNumeric

op_uminus

public IRubyObject op_uminus()
rb_big_uminus


op_plus

public IRubyObject op_plus(ThreadContext context,
                           IRubyObject other)
rb_big_plus


op_plus

public IRubyObject op_plus(ThreadContext context,
                           long other)

op_minus

public IRubyObject op_minus(ThreadContext context,
                            IRubyObject other)
rb_big_minus


op_minus

public IRubyObject op_minus(ThreadContext context,
                            long other)

op_mul

public IRubyObject op_mul(ThreadContext context,
                          IRubyObject other)
rb_big_mul


op_mul

public IRubyObject op_mul(ThreadContext context,
                          long other)

op_div

public IRubyObject op_div(ThreadContext context,
                          IRubyObject other)
rb_big_div


op_idiv

public IRubyObject op_idiv(ThreadContext context,
                           IRubyObject other)
rb_big_idiv


divmod

public IRubyObject divmod(ThreadContext context,
                          IRubyObject other)
rb_big_divmod

Overrides:
divmod in class RubyNumeric

divmod19

public IRubyObject divmod19(ThreadContext context,
                            IRubyObject other)

op_mod

public IRubyObject op_mod(ThreadContext context,
                          IRubyObject other)
rb_big_modulo


remainder

public IRubyObject remainder(ThreadContext context,
                             IRubyObject other)
rb_big_remainder

Overrides:
remainder in class RubyNumeric

remainder19

public IRubyObject remainder19(ThreadContext context,
                               IRubyObject other)

quo

public IRubyObject quo(ThreadContext context,
                       IRubyObject other)
rb_big_quo

Overrides:
quo in class RubyNumeric

quo19

public IRubyObject quo19(ThreadContext context,
                         IRubyObject other)

op_pow

public IRubyObject op_pow(ThreadContext context,
                          IRubyObject other)
rb_big_pow


op_pow19

public IRubyObject op_pow19(ThreadContext context,
                            IRubyObject other)
rb_big_pow


op_and

public IRubyObject op_and(ThreadContext context,
                          IRubyObject other)
rb_big_and


op_and19

public IRubyObject op_and19(ThreadContext context,
                            IRubyObject other)

op_or

public IRubyObject op_or(ThreadContext context,
                         IRubyObject other)
rb_big_or


op_or19

public IRubyObject op_or19(ThreadContext context,
                           IRubyObject other)

op_xor

public IRubyObject op_xor(ThreadContext context,
                          IRubyObject other)
rb_big_xor


op_xor19

public IRubyObject op_xor19(ThreadContext context,
                            IRubyObject other)

op_neg

public IRubyObject op_neg()
rb_big_neg


op_lshift

public IRubyObject op_lshift(IRubyObject other)
rb_big_lshift


op_rshift

public IRubyObject op_rshift(IRubyObject other)
rb_big_rshift


op_aref

public RubyFixnum op_aref(IRubyObject other)
rb_big_aref


compareTo

public final int compareTo(IRubyObject other)
Specified by:
compareTo in interface java.lang.Comparable<IRubyObject>
Overrides:
compareTo in class RubyBasicObject

op_cmp

public IRubyObject op_cmp(ThreadContext context,
                          IRubyObject other)
rb_big_cmp


op_equal

public IRubyObject op_equal(IRubyObject other)
rb_big_eq


eql_p

public IRubyObject eql_p(IRubyObject other)
rb_big_eql

Overrides:
eql_p in class RubyObject

hash

public RubyFixnum hash()
rb_big_hash

Overrides:
hash in class RubyObject

to_f

public IRubyObject to_f()
rb_big_to_f


abs

public IRubyObject abs()
rb_big_abs


size

public IRubyObject size()
rb_big_size


marshalTo

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

unmarshalFrom

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


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