|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jruby.RubyObject
org.jruby.RubyNumeric
org.jruby.RubyInteger
org.jruby.RubyFixnum
Implementation of the Fixnum class.
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 long |
MAX
|
static long |
MAX_MARSHAL_FIXNUM
|
static long |
MIN
|
static long |
MIN_MARSHAL_FIXNUM
|
static byte |
OP_GT_SWITCHVALUE
|
static byte |
OP_LE_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_INT_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 | |
RubyFixnum(Ruby runtime)
|
|
RubyFixnum(Ruby runtime,
long value)
|
Method Summary | |
IRubyObject |
abs()
fix_abs |
IRubyObject |
and(IRubyObject other)
fix_and |
IRubyObject |
aref(IRubyObject other)
fix_aref |
IRubyObject |
callMethod(ThreadContext context,
RubyModule rubyclass,
int methodIndex,
java.lang.String name,
IRubyObject[] args,
CallType callType,
Block block)
|
IRubyObject |
cmp(IRubyObject other)
fix_cmp |
static RubyClass |
createFixnumClass(Ruby runtime)
|
IRubyObject |
div_div(IRubyObject other)
fix_div here is terrible MRI gotcha: 1.div 3.0 -> 0 1 / 3.0 -> 0.3333333333333333 MRI is also able to do it in one place by looking at current frame in rb_num_coerce_bin: rb_funcall(x, ruby_frame->orig_func, 1, y); also note that RubyFloat doesn't override Numeric.div |
IRubyObject |
div_slash(IRubyObject other)
|
IRubyObject |
divmod(IRubyObject other)
fix_divmod |
boolean |
eql(IRubyObject other)
short circuit for Fixnum key comparison |
IRubyObject |
equal(IRubyObject other)
fix_equal |
boolean |
equals(java.lang.Object other)
This method is just a wrapper around the Ruby "==" method, provided so that RubyObjects can be used as keys in the Java HashMap object underlying RubyHash. |
IRubyObject |
freeze()
Freeze an object. |
IRubyObject |
ge(IRubyObject other)
fix_ge |
double |
getDoubleValue()
|
java.lang.Class |
getJavaClass()
RubyMethod getJavaClass. |
long |
getLongValue()
|
int |
getNativeTypeIndex()
This is overridden in the other concrete Java builtins to provide a fast way to determine what type they are. |
IRubyObject |
gt(IRubyObject other)
fix_gt |
RubyFixnum |
hash()
|
int |
hashCode()
|
RubyFixnum |
id()
Return the internal id of an object. |
IRubyObject |
id2name()
fix_id2name |
IRubyObject |
idiv(IRubyObject other,
java.lang.String method)
|
static IRubyObject |
induced_from(IRubyObject recv,
IRubyObject other)
rb_fix_induced_from |
boolean |
isImmediate()
|
IRubyObject |
le(IRubyObject other)
fix_le |
IRubyObject |
lshift(IRubyObject other)
fix_lshift |
IRubyObject |
lt(IRubyObject other)
fix_lt |
static RubyFixnum |
minus_one(Ruby runtime)
|
IRubyObject |
minus(IRubyObject other)
fix_minus |
IRubyObject |
mod(IRubyObject other)
fix_mod |
IRubyObject |
mul(IRubyObject other)
fix_mul |
RubyFixnum |
newFixnum(long newValue)
|
static RubyFixnum |
newFixnum(Ruby runtime,
long value)
|
static RubyFixnum |
one(Ruby runtime)
|
IRubyObject |
or(IRubyObject other)
fix_or |
IRubyObject |
plus(IRubyObject other)
fix_plus |
IRubyObject |
pow(IRubyObject other)
fix_pow |
IRubyObject |
quo(IRubyObject other)
fix_quo |
IRubyObject |
rev()
fix_rev |
IRubyObject |
rshift(IRubyObject other)
fix_rshift |
IRubyObject |
size()
fix_size |
IRubyObject |
taint()
rb_obj_taint |
IRubyObject |
to_f()
fix_to_f |
RubyString |
to_s(IRubyObject[] args)
fix_to_s |
IRubyObject |
to_sym()
fix_to_sym |
IRubyObject |
uminus()
fix_uminus |
static RubyFixnum |
unmarshalFrom(UnmarshalStream input)
|
IRubyObject |
xor(IRubyObject other)
fix_xor |
IRubyObject |
zero_p()
fix_zero_p |
static RubyFixnum |
zero(Ruby runtime)
|
Methods inherited from class org.jruby.RubyInteger |
chr, convertToInteger, createIntegerClass, downto, int_p, succ, times, to_i, toFloat, upto |
Methods inherited from class org.jruby.RubyNumeric |
asNumeric, callCoerced, callCoerced, ceil, checkInt, coerce, coerceBin, coerceBody, coerceCmp, coerceRelOp, createNumericClass, dbl_cmp, dbl2num, div, doCoerce, eql_p, fix2int, fix2long, floor, getCoerced, init_copy, int2fix, modulo, newNumeric, nonzero_p, num2dbl, num2fix, num2int, num2long, remainder, round, sadded, step, str2fnum, str2fnum, str2inum, str2inum, to_int, truncate, uplus |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final long MAX
public static final long MIN
public static final long MAX_MARSHAL_FIXNUM
public static final long MIN_MARSHAL_FIXNUM
public static final byte OP_PLUS_SWITCHVALUE
public static final byte OP_MINUS_SWITCHVALUE
public static final byte OP_LT_SWITCHVALUE
public static final byte TO_S_SWITCHVALUE
public static final byte TO_I_SWITCHVALUE
public static final byte TO_INT_SWITCHVALUE
public static final byte HASH_SWITCHVALUE
public static final byte OP_GT_SWITCHVALUE
public static final byte OP_TIMES_SWITCHVALUE
public static final byte EQUALEQUAL_SWITCHVALUE
public static final byte OP_LE_SWITCHVALUE
public static final byte OP_SPACESHIP_SWITCHVALUE
Constructor Detail |
public RubyFixnum(Ruby runtime)
public RubyFixnum(Ruby runtime, long value)
Method Detail |
public static RubyClass createFixnumClass(Ruby runtime)
public IRubyObject callMethod(ThreadContext context, RubyModule rubyclass, int methodIndex, java.lang.String name, IRubyObject[] args, CallType callType, Block block)
callMethod
in interface IRubyObject
callMethod
in class RubyObject
public int getNativeTypeIndex()
RubyObject
getNativeTypeIndex
in interface IRubyObject
getNativeTypeIndex
in class RubyObject
public final boolean eql(IRubyObject other)
eql
in interface IRubyObject
eql
in class RubyObject
public boolean isImmediate()
isImmediate
in interface IRubyObject
isImmediate
in class RubyObject
public java.lang.Class getJavaClass()
IRubyObject
getJavaClass
in interface IRubyObject
getJavaClass
in class RubyObject
public double getDoubleValue()
getDoubleValue
in class RubyNumeric
public long getLongValue()
getLongValue
in class RubyNumeric
public static RubyFixnum newFixnum(Ruby runtime, long value)
public RubyFixnum newFixnum(long newValue)
public static RubyFixnum zero(Ruby runtime)
public static RubyFixnum one(Ruby runtime)
public static RubyFixnum minus_one(Ruby runtime)
public RubyFixnum hash()
hash
in class RubyObject
public final int hashCode()
hashCode
in class RubyObject
public boolean equals(java.lang.Object other)
RubyObject
equals
in class RubyObject
public RubyString to_s(IRubyObject[] args)
public IRubyObject id2name()
public IRubyObject to_sym()
public IRubyObject uminus()
uminus
in class RubyNumeric
public IRubyObject plus(IRubyObject other)
public IRubyObject minus(IRubyObject other)
public IRubyObject mul(IRubyObject other)
public IRubyObject div_div(IRubyObject other)
public IRubyObject div_slash(IRubyObject other)
public IRubyObject idiv(IRubyObject other, java.lang.String method)
public IRubyObject mod(IRubyObject other)
public IRubyObject divmod(IRubyObject other)
divmod
in class RubyNumeric
public IRubyObject quo(IRubyObject other)
quo
in class RubyNumeric
public IRubyObject pow(IRubyObject other)
public IRubyObject abs()
abs
in class RubyNumeric
public IRubyObject equal(IRubyObject other)
equal
in interface IRubyObject
equal
in class RubyNumeric
public IRubyObject cmp(IRubyObject other)
cmp
in class RubyNumeric
public IRubyObject gt(IRubyObject other)
public IRubyObject ge(IRubyObject other)
public IRubyObject lt(IRubyObject other)
public IRubyObject le(IRubyObject other)
public IRubyObject rev()
public IRubyObject and(IRubyObject other)
public IRubyObject or(IRubyObject other)
public IRubyObject xor(IRubyObject other)
public IRubyObject aref(IRubyObject other)
public IRubyObject lshift(IRubyObject other)
public IRubyObject rshift(IRubyObject other)
public IRubyObject to_f()
public IRubyObject size()
public IRubyObject zero_p()
zero_p
in class RubyNumeric
public RubyFixnum id()
RubyObject
id
in interface IRubyObject
id
in class RubyObject
public IRubyObject taint()
RubyObject
taint
in class RubyObject
public IRubyObject freeze()
RubyObject
freeze
in class RubyObject
public static RubyFixnum unmarshalFrom(UnmarshalStream input) throws java.io.IOException
java.io.IOException
public static IRubyObject induced_from(IRubyObject recv, IRubyObject other)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |