org.jruby
Class RubyFixnum

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

public class RubyFixnum
extends RubyInteger

Implementation of the Fixnum class.

Version:
$Revision: 1.11 $
Author:
jpetersen

Field Summary
static long MAX
           
static long MIN
           
 
Fields inherited from class org.jruby.RubyObject
runtime
 
Fields inherited from interface org.jruby.runtime.builtin.IRubyObject
NULL_ARRAY
 
Constructor Summary
RubyFixnum(Ruby ruby)
           
RubyFixnum(Ruby ruby, long value)
           
 
Method Summary
 RubyFixnum aref(RubyNumeric other)
           
protected  int compareValue(RubyNumeric other)
           
static RubyClass createFixnumClass(Ruby ruby)
           
 IRubyObject freeze()
          Freeze an object.
 double getDoubleValue()
           
 java.lang.Class getJavaClass()
          Method getJavaClass.
 long getLongValue()
           
 RubyFixnum hash()
           
 RubyFixnum id()
          Return the internal id of an object.
 RubyString id2name()
           
static RubyInteger induced_from(IRubyObject recv, IRubyObject number)
           
 RubyFixnum invert()
           
 void marshalTo(MarshalStream output)
          Method marshalTo.
static RubyFixnum minus_one(Ruby ruby)
           
 RubyNumeric multiplyWith(RubyFixnum other)
           
 RubyNumeric multiplyWith(RubyFloat other)
           
 RubyNumeric multiplyWith(RubyInteger other)
           
 RubyFixnum newFixnum(long value)
           
static RubyFixnum newFixnum(Ruby ruby, long value)
           
static RubyFixnum one(Ruby ruby)
           
 RubyNumeric op_and(RubyNumeric other)
           
 RubyNumeric op_div(RubyNumeric other)
           
 RubyInteger op_lshift(RubyNumeric other)
           
 RubyNumeric op_minus(RubyNumeric other)
           
 RubyNumeric op_mod(RubyNumeric other)
           
 RubyNumeric op_mul(RubyNumeric other)
           
 RubyInteger op_or(RubyNumeric other)
           
 RubyNumeric op_plus(RubyNumeric other)
           
 RubyNumeric op_pow(RubyNumeric other)
           
 RubyInteger op_rshift(RubyNumeric other)
           
 RubyInteger op_xor(RubyNumeric other)
           
 boolean singletonMethodsAllowed()
           
 RubyFixnum size()
           
 IRubyObject taint()
          rb_obj_taint
 IRubyObject times()
           
 RubyFloat to_f()
           
 RubyString to_s()
           
static RubyFixnum unmarshalFrom(UnmarshalStream input)
           
static RubyFixnum zero(Ruby ruby)
           
 
Methods inherited from class org.jruby.RubyInteger
chr, createIntegerClass, downto, int_p, multiplyWith, next, step, to_i, toFloat, upto
 
Methods inherited from class org.jruby.RubyNumeric
abs, ceil, cmp, coerce, createNumericClass, divmod, eql, equal, fix2int, fix2long, floor, getCoerce, getTruncatedLongValue, modulo, nonzero_p, num2long, numericValue, op_uminus, op_uplus, rbClone, remainder, round, str2fnum, str2inum, truncate, veryEqual, zero_p
 
Methods inherited from class org.jruby.RubyObject
argCount, asSymbol, callbackFactory, callInit, callMethod, callMethod, callMethod, checkSafeString, convertToString, convertToType, convertType, createObjectClass, defineSingletonMethod, display, dup, equals, eval, eval, evalUnder, extend, extendObject, frozen, getInstanceVariable, getInstanceVariables, getMetaClass, getRuntime, getSingletonClass, getType, hashCode, hasInstanceVariable, infectBy, inspect, instance_eval, instance_of, instance_variables, instanceVariableNames, isFalse, isFrozen, isKindOf, isNil, isTaint, isTrue, kind_of, makeMetaClass, method_missing, method, methods, nilObject, private_methods, protected_methods, removeInstanceVariable, respond_to, respondsTo, send, setFrozen, setInstanceVariable, setInstanceVariable, setInstanceVariables, setMetaClass, setTaint, setupClone, singleton_methods, specificEval, tainted, to_a, toString, type, untaint
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

MAX

public static final long MAX
See Also:
Constant Field Values

MIN

public static final long MIN
See Also:
Constant Field Values
Constructor Detail

RubyFixnum

public RubyFixnum(Ruby ruby)

RubyFixnum

public RubyFixnum(Ruby ruby,
                  long value)
Method Detail

createFixnumClass

public static RubyClass createFixnumClass(Ruby ruby)

getJavaClass

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

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

getDoubleValue

public double getDoubleValue()
Specified by:
getDoubleValue in class RubyNumeric

getLongValue

public long getLongValue()
Specified by:
getLongValue in class RubyNumeric

zero

public static RubyFixnum zero(Ruby ruby)

one

public static RubyFixnum one(Ruby ruby)

minus_one

public static RubyFixnum minus_one(Ruby ruby)

compareValue

protected int compareValue(RubyNumeric other)
Overrides:
compareValue in class RubyNumeric

hash

public RubyFixnum hash()
Overrides:
hash in class RubyObject

newFixnum

public static RubyFixnum newFixnum(Ruby ruby,
                                   long value)

newFixnum

public RubyFixnum newFixnum(long value)

singletonMethodsAllowed

public boolean singletonMethodsAllowed()
Specified by:
singletonMethodsAllowed in interface IRubyObject
Overrides:
singletonMethodsAllowed in class RubyObject

induced_from

public static RubyInteger induced_from(IRubyObject recv,
                                       IRubyObject number)

op_plus

public RubyNumeric op_plus(RubyNumeric other)

op_minus

public RubyNumeric op_minus(RubyNumeric other)

op_mul

public RubyNumeric op_mul(RubyNumeric other)

multiplyWith

public RubyNumeric multiplyWith(RubyFixnum other)
Overrides:
multiplyWith in class RubyNumeric

multiplyWith

public RubyNumeric multiplyWith(RubyInteger other)
Specified by:
multiplyWith in class RubyNumeric

multiplyWith

public RubyNumeric multiplyWith(RubyFloat other)
Specified by:
multiplyWith in class RubyNumeric

op_div

public RubyNumeric op_div(RubyNumeric other)

op_mod

public RubyNumeric op_mod(RubyNumeric other)

op_pow

public RubyNumeric op_pow(RubyNumeric other)

to_s

public RubyString to_s()
Overrides:
to_s in class RubyObject

to_f

public RubyFloat to_f()

op_lshift

public RubyInteger op_lshift(RubyNumeric other)

op_rshift

public RubyInteger op_rshift(RubyNumeric other)

op_and

public RubyNumeric op_and(RubyNumeric other)

op_or

public RubyInteger op_or(RubyNumeric other)

op_xor

public RubyInteger op_xor(RubyNumeric other)

size

public RubyFixnum size()

aref

public RubyFixnum aref(RubyNumeric other)

id2name

public RubyString id2name()

invert

public RubyFixnum invert()

id

public RubyFixnum id()
Description copied from class: RubyObject
Return the internal id of an object. Warning: In JRuby there is no guarantee that two objects have different ids. CRuby function: rb_obj_id

Overrides:
id in class RubyObject

taint

public IRubyObject taint()
Description copied from class: RubyObject
rb_obj_taint

Overrides:
taint in class RubyObject

freeze

public IRubyObject freeze()
Description copied from class: RubyObject
Freeze an object. rb_obj_freeze

Overrides:
freeze in class RubyObject

times

public IRubyObject times()
Overrides:
times in class RubyInteger

marshalTo

public void marshalTo(MarshalStream output)
               throws java.io.IOException
Description copied from interface: IRubyObject
Method marshalTo.

Specified by:
marshalTo in interface IRubyObject
Overrides:
marshalTo in class RubyObject
Throws:
java.io.IOException

unmarshalFrom

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


Copyright © 2002 Jan Arne Petersen. All Rights Reserved.