org.jruby
Class RubyBignum

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

public class RubyBignum
extends RubyInteger

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
static byte EQUALEQUAL_SWITCHVALUE
           
static byte HASH_SWITCHVALUE
           
static byte OP_LT_SWITCHVALUE
           
static byte OP_MINUS_SWITCHVALUE
           
static byte OP_PLUS_SWITCHVALUE
           
static byte OP_SPACESHIP_SWITCHVALUE
           
static byte OP_TIMES_SWITCHVALUE
           
static byte TO_I_SWITCHVALUE
           
static byte TO_S_SWITCHVALUE
           
 
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
RubyBignum(Ruby runtime, java.math.BigInteger value)
           
 
Method Summary
 IRubyObject abs()
          rb_big_abs
 IRubyObject and(IRubyObject other)
          rb_big_and
 RubyFixnum aref(IRubyObject other)
          rb_big_aref
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 callMethod(ThreadContext context, RubyModule rubyclass, int methodIndex, java.lang.String name, IRubyObject[] args, CallType callType, Block block)
           
 IRubyObject cmp(IRubyObject other)
          rb_big_cmp
 IRubyObject coerce(IRubyObject other)
          rb_big_coerce
static RubyClass createBignumClass(Ruby runtime)
           
 IRubyObject div(IRubyObject other)
          rb_big_div
 IRubyObject divmod(IRubyObject other)
          rb_big_divmod
 IRubyObject eql_p(IRubyObject other)
          rb_big_eql
 IRubyObject equal(IRubyObject other)
          rb_big_eq
static java.math.BigInteger fix2big(RubyFixnum arg)
          rb_int2big
 double getDoubleValue()
           
 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
 IRubyObject lshift(IRubyObject other)
          rb_big_lshift
static void marshalTo(RubyBignum bignum, MarshalStream output)
           
 IRubyObject minus(IRubyObject other)
          rb_big_minus
 IRubyObject mod(IRubyObject other)
          rb_big_modulo
 IRubyObject mul(IRubyObject other)
          rb_big_mul
 IRubyObject neg()
          rb_big_neg
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 or(IRubyObject other)
          rb_big_or
 IRubyObject plus(IRubyObject other)
          rb_big_plus
 IRubyObject pow(IRubyObject other)
          rb_big_pow
 IRubyObject quo(IRubyObject other)
          rb_big_quo
 IRubyObject remainder(IRubyObject other)
          rb_big_remainder
 IRubyObject rshift(IRubyObject other)
          rb_big_rshift
 RubyFixnum size()
          rb_big_size
 IRubyObject to_f()
          rb_big_to_f
 IRubyObject to_s(IRubyObject[] args)
          rb_big_to_s
 IRubyObject uminus()
          rb_big_uminus
static RubyNumeric unmarshalFrom(UnmarshalStream input)
           
 IRubyObject xor(IRubyObject other)
          rb_big_xor
 
Methods inherited from class org.jruby.RubyInteger
chr, convertToInteger, createIntegerClass, downto, induced_from, int_p, succ, times, to_i, toFloat, upto
 
Methods inherited from class org.jruby.RubyNumeric
asNumeric, callCoerced, callCoerced, ceil, checkInt, coerceBin, coerceBody, coerceCmp, coerceRelOp, createNumericClass, dbl_cmp, dbl2num, doCoerce, fix2int, fix2long, floor, getCoerced, init_copy, int2fix, modulo, newNumeric, nonzero_p, num2dbl, num2fix, num2int, num2long, round, sadded, step, str2fnum, str2fnum, str2inum, str2inum, to_int, truncate, uplus, zero_p
 
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, callMethodMissingIfNecessary, callSuper, checkArrayType, checkFrozen, checkStringType, compilerCallMethod, compilerCallMethodWithIndex, convertToArray, convertToFloat, convertToHash, convertToString, convertToType, convertToType, convertToType, convertToTypeWithCheck, createObjectClass, dataGetStruct, dataWrapStruct, display, doClone, dup, eql, eqlInternal, equalInternal, equals, evalSimple, evalUnder, evalWithBinding, extend, freeze, frozen, getInstanceVariable, getInstanceVariables, getInstanceVariablesSnapshot, getJavaClass, getMetaClass, getRuntime, getSingletonClass, getSingletonClassClone, getType, hashCode, 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, to_s, toString, trueFalseNil, trueFalseNil, type_deprecated, type, untaint
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

OP_PLUS_SWITCHVALUE

public static final byte OP_PLUS_SWITCHVALUE
See Also:
Constant Field Values

OP_MINUS_SWITCHVALUE

public static final byte OP_MINUS_SWITCHVALUE
See Also:
Constant Field Values

OP_LT_SWITCHVALUE

public static final byte OP_LT_SWITCHVALUE
See Also:
Constant Field Values

TO_S_SWITCHVALUE

public static final byte TO_S_SWITCHVALUE
See Also:
Constant Field Values

TO_I_SWITCHVALUE

public static final byte TO_I_SWITCHVALUE
See Also:
Constant Field Values

HASH_SWITCHVALUE

public static final byte HASH_SWITCHVALUE
See Also:
Constant Field Values

OP_TIMES_SWITCHVALUE

public static final byte OP_TIMES_SWITCHVALUE
See Also:
Constant Field Values

EQUALEQUAL_SWITCHVALUE

public static final byte EQUALEQUAL_SWITCHVALUE
See Also:
Constant Field Values

OP_SPACESHIP_SWITCHVALUE

public static final byte OP_SPACESHIP_SWITCHVALUE
See Also:
Constant Field Values
Constructor Detail

RubyBignum

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

createBignumClass

public static RubyClass createBignumClass(Ruby runtime)

callMethod

public IRubyObject callMethod(ThreadContext context,
                              RubyModule rubyclass,
                              int methodIndex,
                              java.lang.String name,
                              IRubyObject[] args,
                              CallType callType,
                              Block block)
Specified by:
callMethod in interface IRubyObject
Overrides:
callMethod in class RubyObject

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

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

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


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

uminus

public IRubyObject uminus()
rb_big_uminus

Overrides:
uminus in class RubyNumeric

plus

public IRubyObject plus(IRubyObject other)
rb_big_plus


minus

public IRubyObject minus(IRubyObject other)
rb_big_minus


mul

public IRubyObject mul(IRubyObject other)
rb_big_mul


div

public IRubyObject div(IRubyObject other)
rb_big_div

Overrides:
div in class RubyNumeric

divmod

public IRubyObject divmod(IRubyObject other)
rb_big_divmod

Overrides:
divmod in class RubyNumeric

mod

public IRubyObject mod(IRubyObject other)
rb_big_modulo


remainder

public IRubyObject remainder(IRubyObject other)
rb_big_remainder

Overrides:
remainder in class RubyNumeric

quo

public IRubyObject quo(IRubyObject other)
rb_big_quo

Overrides:
quo in class RubyNumeric

pow

public IRubyObject pow(IRubyObject other)
rb_big_pow


and

public IRubyObject and(IRubyObject other)
rb_big_and


or

public IRubyObject or(IRubyObject other)
rb_big_or


xor

public IRubyObject xor(IRubyObject other)
rb_big_xor


neg

public IRubyObject neg()
rb_big_neg


lshift

public IRubyObject lshift(IRubyObject other)
rb_big_lshift


rshift

public IRubyObject rshift(IRubyObject other)
rb_big_rshift


aref

public RubyFixnum aref(IRubyObject other)
rb_big_aref


cmp

public IRubyObject cmp(IRubyObject other)
rb_big_cmp

Overrides:
cmp in class RubyNumeric

equal

public IRubyObject equal(IRubyObject other)
rb_big_eq

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

eql_p

public IRubyObject eql_p(IRubyObject other)
rb_big_eql

Overrides:
eql_p in class RubyNumeric

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

Overrides:
abs in class RubyNumeric

size

public RubyFixnum 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-2007 JRuby Team. All Rights Reserved.