Package org.jruby
Class RubyFixnum
java.lang.Object
org.jruby.RubyBasicObject
org.jruby.RubyObject
org.jruby.RubyNumeric
org.jruby.RubyInteger
org.jruby.RubyFixnum
- All Implemented Interfaces:
Serializable
,Cloneable
,Comparable<IRubyObject>
,Appendable
,Constantizable
,InstanceVariables
,InternalVariables
,IRubyObject
,CoreObjectType
Implementation of the Integer (Fixnum internal) class.
- See Also:
-
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
Nested classes/interfaces inherited from class org.jruby.RubyBasicObject
RubyBasicObject.Finalizer
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
static final long
static final long
static final long
static final long
static final long
static final boolean
Fields inherited from class org.jruby.RubyInteger
NUMERR_NEGATIVE, NUMERR_TOOLARGE, NUMERR_TYPE
Fields inherited from class org.jruby.RubyNumeric
DBL_EPSILON
Fields inherited from class org.jruby.RubyObject
IVAR_INSPECTING_OBJECT_ALLOCATOR, OBJECT_ALLOCATOR, REIFYING_OBJECT_ALLOCATOR
Fields inherited from class org.jruby.RubyBasicObject
ALL_F, BASICOBJECT_ALLOCATOR, COMPARE_BY_IDENTITY_F, ERR_INSECURE_SET_INST_VAR, FALSE_F, FL_USHIFT, flags, FROZEN_F, IS_OVERLAID_F, metaClass, NEVER, NIL_F, REFINED_MODULE_F, STAMP_OFFSET, TAINTED_F, UNDEF, USER0_F, USER1_F, USER2_F, USER3_F, USER4_F, USER5_F, USER6_F, USER7_F, USER8_F, USER9_F, USERA_F, VAR_TABLE_OFFSET, varTable, varTableStamp
Fields inherited from interface org.jruby.runtime.builtin.IRubyObject
NULL_ARRAY
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabs
(ThreadContext context) fix_absvoid
appendIntoString
(RubyString target) asBigInteger
(ThreadContext context) Return a BigInteger representation of this numerical valuedouble
asDouble
(ThreadContext context) Return a double representation of this numerical valueint
asInt
(ThreadContext context) Returns the value of this numeric and a java int.rb_to_id Will try to convert this object to a String using the Ruby "to_str" if the object isn't already a String.long
asLong
(ThreadContext context) Return the value of this numeric as a 64-bit long.bit_length
(ThreadContext context) ceil
(ThreadContext context, IRubyObject arg) rb_fix_ceilfinal int
compareTo
(IRubyObject other) Compares this Ruby object with another.constant()
convertToInteger
(String method) Tries to convert this object to a Ruby Integer using the supplied conversion method.convertToRational
(ThreadContext context) static RubyClass
createFixnumClass
(ThreadContext context, RubyClass fixnum) denominator
(ThreadContext context) numeric_denominatordigits
(ThreadContext context, IRubyObject baseArg) rb_fix_digitsdivmod
(ThreadContext context, IRubyObject other) fix_divmodfinal boolean
eql
(IRubyObject other) short circuit for Fixnum key comparisonequal_p
(ThreadContext context, IRubyObject obj) rb_obj_equal Will use Java identity equality.boolean
This override does not do a "checked" dispatch.even_p
(ThreadContext context) final boolean
fastEqual
(RubyFixnum other) fdivDouble
(ThreadContext context, IRubyObject y) static RubyFixnum
floor
(ThreadContext context, IRubyObject arg) rb_fix_floorstatic RubyFixnum
double
Deprecated.Class
<?> Will return the Java interface that most closely can represent this object, when working through Java integration translations.long
Deprecated.This is overridden in the other concrete Java builtins to provide a fast way to determine what type they are.long
getValue()
When you know you are working directly with a Fixnum you can get the long value it represents without usingRubyNumeric.asLong(ThreadContext)
.hash
(ThreadContext context) Will return the hash code of this object.final int
hashCode()
This override does not do "checked" dispatch since Object usually has #hash defined.id()
rb_obj_id Return the internal id of an object.idiv
(ThreadContext context, long other) idiv
(ThreadContext context, long y, String method) Deprecated.idiv
(ThreadContext context, 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.dividiv
(ThreadContext context, IRubyObject other, String method) Deprecated.idiv
(ThreadContext context, IRubyObject other, CallSite site) static IRubyObject
induced_from
(IRubyObject recv, IRubyObject other) Deprecated.protected boolean
int_round_zero_p
(ThreadContext context, int ndigits) protected IRubyObject
intPowTmp1
(ThreadContext context, RubyInteger y, long mm, boolean negaFlg) protected IRubyObject
intPowTmp2
(ThreadContext context, IRubyObject y, long mm, boolean negaFlg) Deprecated.boolean
Is object immediate (def: Fixnum, Symbol, true, false, nil?).isNegative
(ThreadContext context) num_negative_pisPositive
(ThreadContext context) num_positive_pfinal boolean
isZero
(ThreadContext context) magnitude
(ThreadContext context) fix_abs/1.9static RubyFixnum
modulo
(ThreadContext context, IRubyObject other) num_modulonegate
(ThreadContext context) final RubyFixnum
newFixnum
(long newValue) Deprecated.static RubyFixnum
static RubyFixnum
nonzero_p
(ThreadContext context) num_nonzero_pnumerator
(ThreadContext context) numeric_numeratorodd_p
(ThreadContext context) static RubyFixnum
op_and
(ThreadContext context, long other) op_and
(ThreadContext context, IRubyObject other) fix_andprotected IRubyObject
op_aref_subclass
(ThreadContext context, IRubyObject other) rb_fix_arefop_cmp
(ThreadContext context, double other) op_cmp
(ThreadContext context, long other) op_cmp
(ThreadContext context, IRubyObject other) fix_cmpop_div
(ThreadContext context, long other) op_div
(ThreadContext context, IRubyObject other) op_equal
(ThreadContext context, double other) op_equal
(ThreadContext context, long other) op_equal
(ThreadContext context, IRubyObject other) fix_equalboolean
op_equal_boolean
(ThreadContext context, long other) op_ge
(ThreadContext context, long other) op_ge
(ThreadContext context, IRubyObject other) fix_geboolean
op_ge_boolean
(ThreadContext context, long other) op_gt
(ThreadContext context, long other) op_gt
(ThreadContext context, IRubyObject other) fix_gtboolean
op_gt_boolean
(ThreadContext context, long other) op_le
(ThreadContext context, long other) op_le
(ThreadContext context, IRubyObject other) fix_leboolean
op_le_boolean
(ThreadContext context, long other) op_lshift
(long width) Deprecated.op_lshift
(ThreadContext context, long width) op_lshift
(ThreadContext context, IRubyObject other) fix_lshiftop_lt
(ThreadContext context, long other) op_lt
(ThreadContext context, IRubyObject other) fix_ltboolean
op_lt_boolean
(ThreadContext context, long other) op_minus
(ThreadContext context, double other) op_minus
(ThreadContext context, long other) op_minus
(ThreadContext context, IRubyObject other) fix_minusop_minus_one
(ThreadContext context) op_minus_two
(ThreadContext context) op_mod
(ThreadContext context, long other) op_mod
(ThreadContext context, IRubyObject other) fix_modop_mul
(ThreadContext context, double other) op_mul
(ThreadContext context, long other) op_mul
(ThreadContext context, IRubyObject other) fix_mulop_neg
(ThreadContext context) fix_revop_not_equal
(ThreadContext context, double other) op_not_equal
(ThreadContext context, long other) op_not_equal
(ThreadContext context, IRubyObject other) fix_not_equalop_or
(ThreadContext context, long other) op_or
(ThreadContext context, IRubyObject other) fix_orop_plus
(ThreadContext context, double other) op_plus
(ThreadContext context, long other) op_plus
(ThreadContext context, IRubyObject other) fix_plusop_plus_one
(ThreadContext context) op_plus_two
(ThreadContext context) op_pow
(ThreadContext context, long other) op_pow
(ThreadContext context, IRubyObject other) fix_powop_rshift
(long width) Deprecated.op_rshift
(ThreadContext context, long width) op_rshift
(ThreadContext context, IRubyObject other) fix_rshiftop_uminus
(ThreadContext context) fix_uminusop_xor
(ThreadContext context, long other) op_xor
(ThreadContext context, IRubyObject other) fix_xorpred
(ThreadContext context) remainder
(ThreadContext context, IRubyObject y) num_remainderint
signum
(ThreadContext context) singletonClass
(ThreadContext context) Will either return the existing singleton class for this object, or create a new one and return that.size
(ThreadContext context) fix_sizesqrt
(ThreadContext context) succ
(ThreadContext context) int_succtaint
(ThreadContext context) Deprecated.static RubyFixnum
times
(ThreadContext context, Block block) to_f()
Deprecated.to_f
(ThreadContext context) fix_to_fto_s
(IRubyObject[] args) Deprecated.to_s
(ThreadContext context) to_s
(ThreadContext context, IRubyObject arg0) to_sym()
Deprecated.truncate
(ThreadContext context, IRubyObject arg) rb_fix_truncatestatic RubyFixnum
static RubyFixnum
unmarshalFrom
(UnmarshalStream input) Deprecated, for removal: This API element is subject to removal in a future version.static RubyFixnum
unmarshalFrom
(ThreadContext context, RubyInputStream in, MarshalLoader input) static RubyFixnum
zero_p()
Deprecated.zero_p
(ThreadContext context) fix_zero_pMethods inherited from class org.jruby.RubyInteger
allbits_p, anybits_p, ceil, ceil, chr, chr, convertToInteger, createIntegerClass, digits, div_div, downto, fdiv, floor, floor, floorSqrt, floorSqrt, gcd, gcdlcm, induced_from, int_half_p_half_down, int_half_p_half_even, int_half_p_half_up, int_round_half_down, int_round_half_even, int_round_half_up, integer_p, integerCeil, integerFloor, intPowTmp3, isNegativeNumber, isPositiveNumber, lcm, negate, nobits_p, numToUint, numToUint, op_aref, op_aref, op_aref, op_idiv, op_lshift, op_neg, op_rshift, op_uminus, ord, pow, pow, rationalize, round, round, round, round, round, roundShared, signum, singleCharByteList, singleCharString, singleCharUTF8ByteList, size, sqrt, timesSize, to_i, to_i, to_r, to_s, to_s, toFloat, truncate, truncate, try_convert, upto
Methods inherited from class org.jruby.RubyNumeric
abs2, arg, asNumeric, callCoerced, callCoerced, callCoerced, callCoerced, checkInt, checkInt, coerce, coerce, coerceBin, coerceBin, coerceBit, coerceBit, coerceCmp, coerceCmp, coerceFailed, coerceRelOp, coerceRelOp, coerceRescue, compareWithZero, conjugate, convertToRational, createNumericClass, dbl_cmp, dbl2ival, dbl2num, div, doCoerce, dup, eql_p, finite_p, fix2int, fix2int, fix2long, fixable, float2long, float2ulong, floatStep, floatStepSize, getBigIntegerValue, getCoerced, getIntValue, getRoundingMode, image, infinite_p, initialize_copy, int2fix, integer_p, intervalStepSize, isNegative, isPositive, isReal, isZero, negativeInt, negFixable, negFixable, newNumeric, num_imaginary, num2chr, num2dbl, num2dbl, num2fix, num2fix, num2int, num2long, num2ulong, numFuncall, numFuncall, numRemainder, op_not, op_num_equal, op_uplus, op_uplus, polar, posFixable, posFixable, positiveInt, quo, rbClone, rbClone, rbClone, rbClone, real, real_p, rect, scalar_p, singleton_method_added, step, str2fnum, str2fnum, str2fnum, str2inum, str2inum, str2inum, to_c, to_int, toJava
Methods inherited from class org.jruby.RubyObject
attachToObjectSpace, callInit, callInit, callInit, callInit, callInit, callInit, callInit, callInit, callInit, callInit, convertToType, dig, dig1, dig2, eqlInternal, equalInternal, finishObjectClass, inspect, op_eqq, puts, specificEval, toRubyString, toString
Methods inherited from class org.jruby.RubyBasicObject
addFinalizer, addFinalizer, anyToString, asString, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callSuper, checkArrayType, checkCallMethod, checkCallMethod, checkFrozen, checkStringType, cloneSetup, convertToArray, convertToFloat, convertToHash, convertToInteger, convertToString, copyInstanceVariablesInto, copySpecialInstanceVariables, dataGetStruct, dataGetStructChecked, dataWrapStruct, decode, display, dupFinalizer, dupSetup, ensureInstanceVariablesSettable, eql_p, evalUnder, extend, fastGetInstanceVariable, fastGetInternalVariable, fastHasInstanceVariable, fastHasInternalVariable, fastSetInstanceVariable, fastSetInternalVariable, finishBasicObjectClass, forEachInstanceVariable, forEachInstanceVariableName, freeze, frozen_p, getCurrentContext, getFFIHandle, getFlag, getInstanceEvalClass, getInstanceEvalClass, getInstanceVariable, getInstanceVariableList, getInstanceVariableNameList, getInstanceVariables, getInternalVariable, getInternalVariables, getMarshalVariableList, getMetaClass, getMetaClass, getNativeHandle, getNativeTypeIndex, getObjectId, getRuntime, getSingletonClass, getSingletonClassClone, getSingletonClassCloneAndAttach, getSingletonClassCloneAndAttach, getType, getVariable, getVariableCount, getVariableList, getVariableNameList, hash, hashyInspect, hasInstanceVariable, hasInstanceVariables, hasInternalVariable, hasVariables, infectBy, initialize, initialize_copy, inspect, inspect, inspectHashCode, 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, isBuiltin, isClass, isFalse, isFrozen, isModule, isNil, isSpecialConst, isSpecialObject, isTaint, isTrue, isUntrusted, kind_of_p, makeMetaClass, makeMetaClass, makeMetaClassBootstrap, method, method, method, method_missing, methods, methods, nil_p, nonFixnumHashCode, nonFixnumHashCode, OBJ_INIT_COPY, objInitCopy, op_match, op_not_match, private_methods, protected_methods, public_methods, rbInspect, remove_instance_variable, removeFinalizers, removeInstanceVariable, removeInternalVariable, respond_to_p, respond_to_p, respondsTo, respondsToMissing, respondsToMissing, send, send, send, send, send, setFFIHandle, setFlag, setFrozen, setInstanceVariable, setInternalVariable, setMetaClass, setNativeHandle, setTaint, setUntrusted, setVariable, singleton_method, singleton_method, singleton_method_added, singleton_method_removed, singleton_method_undefined, singleton_methods, specificEval, specificEval, specificEval, specificEval, syncVariables, syncVariables, taint, tainted_p, testFrozen, testFrozen, to_a, to_a, trust, type, untaint, untrust, untrusted_p, validateInstanceVariable, validateInstanceVariable, validateInstanceVariable, variableTableContains, variableTableFastContains, variableTableFastFetch, variableTableFastStore, variableTableFetch, variableTableRemove, variableTableStore, variableTableSync, yieldUnder, yieldUnder
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.jruby.runtime.builtin.IRubyObject
checkStringType19, dup, marshalLiveVariables
-
Field Details
-
SIGN_BIT
public static final long SIGN_BIT- See Also:
-
MAX
public static final long MAX- See Also:
-
MIN
public static final long MIN- See Also:
-
MAX_MARSHAL_FIXNUM
public static final long MAX_MARSHAL_FIXNUM- See Also:
-
MIN_MARSHAL_FIXNUM
public static final long MIN_MARSHAL_FIXNUM- See Also:
-
USE_CACHE
public static final boolean USE_CACHE -
CACHE_OFFSET
public static final int CACHE_OFFSET
-
-
Constructor Details
-
RubyFixnum
-
RubyFixnum
-
-
Method Details
-
createFixnumClass
-
getNativeClassIndex
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:
getNativeClassIndex
in interfaceCoreObjectType
- Overrides:
getNativeClassIndex
in classRubyObject
- Returns:
- the ClassIndex of the native type this object was constructed from
- See Also:
-
constant
- Specified by:
constant
in interfaceConstantizable
- See Also:
-
eql
short circuit for Fixnum key comparison- Specified by:
eql
in interfaceIRubyObject
- Overrides:
eql
in classRubyBasicObject
- Returns:
- Will by default just call the Ruby method "eql?"
-
equal_p
Description copied from class:RubyBasicObject
rb_obj_equal Will use Java identity equality.- Overrides:
equal_p
in classRubyBasicObject
- Parameters:
context
- the thread contextobj
- to compare with- Returns:
- are they equal?
-
isImmediate
public boolean isImmediate()Description copied from class:RubyBasicObject
Is object immediate (def: Fixnum, Symbol, true, false, nil?).- Specified by:
isImmediate
in interfaceIRubyObject
- Overrides:
isImmediate
in classRubyBasicObject
- Returns:
- boolean
-
singletonClass
Description copied from class:RubyBasicObject
Will either return the existing singleton class for this object, or create a new one and return that. For a few types a singleton class is not possible so it will throw an error.- Specified by:
singletonClass
in interfaceIRubyObject
- Overrides:
singletonClass
in classRubyBasicObject
- Parameters:
context
- the current thread context- Returns:
- the singleton of this type
-
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 interfaceIRubyObject
- Overrides:
getJavaClass
in classRubyBasicObject
- Returns:
- the true Java class of this (Ruby) object
-
asBigInteger
Description copied from class:RubyNumeric
Return a BigInteger representation of this numerical value- Overrides:
asBigInteger
in classRubyNumeric
- Parameters:
context
- the current thread context- Returns:
- a BigInteger
-
asDouble
Description copied from class:RubyNumeric
Return a double representation of this numerical value- Overrides:
asDouble
in classRubyNumeric
- Parameters:
context
- the current thread context- Returns:
- a double
-
asInt
Description copied from class:RubyNumeric
Returns the value of this numeric and a java int.- Overrides:
asInt
in classRubyNumeric
-
asLong
Description copied from class:RubyNumeric
Return the value of this numeric as a 64-bit long.- Overrides:
asLong
in classRubyNumeric
-
getDoubleValue
Deprecated.- Overrides:
getDoubleValue
in classRubyNumeric
- Returns:
-
getLongValue
Deprecated.Description copied from class:RubyNumeric
Return the value of this numeric as a 64-bit long. If the value does not fit in 64 bits, it will be truncated.- Overrides:
getLongValue
in classRubyNumeric
-
getValue
public long getValue()When you know you are working directly with a Fixnum you can get the long value it represents without usingRubyNumeric.asLong(ThreadContext)
.- Returns:
- the long value
-
signum
- Overrides:
signum
in classRubyInteger
-
negate
- Overrides:
negate
in classRubyInteger
-
newFixnum
-
newFixnum
-
newFixnum
Deprecated. -
zero
-
one
-
two
-
three
-
four
-
five
-
minus_one
-
hash
Description copied from class:RubyBasicObject
Will return the hash code of this object. In comparison to MRI, this method will use the Java identity hash code instead of using rb_obj_id, since the usage of id in JRuby will incur the cost of some. ObjectSpace maintenance.- Overrides:
hash
in classRubyBasicObject
- Parameters:
context
- the current thread context- Returns:
- the hash value
-
hashCode
public final int hashCode()Description copied from class:RubyObject
This override does not do "checked" dispatch since Object usually has #hash defined.- Overrides:
hashCode
in classRubyObject
- Returns:
- the hash code
- See Also:
-
times
- Overrides:
times
in classRubyInteger
-
ceil
rb_fix_ceil- Specified by:
ceil
in classRubyInteger
-
floor
rb_fix_floor- Specified by:
floor
in classRubyInteger
-
truncate
rb_fix_truncate- Specified by:
truncate
in classRubyInteger
-
digits
rb_fix_digits- Specified by:
digits
in classRubyInteger
-
to_s
Deprecated.fix_to_s -
to_s
- Overrides:
to_s
in classRubyInteger
-
to_s
- Overrides:
to_s
in classRubyInteger
-
to_sym
Deprecated.fix_to_sym -
op_uminus
fix_uminus- Specified by:
op_uminus
in classRubyInteger
-
op_plus
fix_plus- Specified by:
op_plus
in classRubyInteger
-
op_plus
- Overrides:
op_plus
in classRubyInteger
-
op_plus
-
op_plus_one
-
op_plus_two
-
op_minus
fix_minus- Specified by:
op_minus
in classRubyInteger
-
op_minus
- Overrides:
op_minus
in classRubyInteger
-
op_minus
-
op_minus_one
- Parameters:
context
-- Returns:
- RubyInteger
-
op_minus_two
- Parameters:
context
-- Returns:
- RubyInteger
-
op_mul
fix_mul- Specified by:
op_mul
in classRubyInteger
-
op_mul
- Overrides:
op_mul
in classRubyInteger
-
op_mul
-
idiv
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- Specified by:
idiv
in classRubyInteger
-
idiv
- Overrides:
idiv
in classRubyNumeric
-
op_div
- Specified by:
op_div
in classRubyInteger
-
op_div
-
odd_p
- Overrides:
odd_p
in classRubyInteger
-
even_p
- Overrides:
even_p
in classRubyInteger
-
pred
- Overrides:
pred
in classRubyInteger
-
idiv
Deprecated. -
idiv
-
idiv
Deprecated. -
op_mod
fix_mod- Specified by:
op_mod
in classRubyInteger
-
op_mod
- Overrides:
op_mod
in classRubyInteger
-
modulo
Description copied from class:RubyNumeric
num_modulo- Overrides:
modulo
in classRubyNumeric
-
divmod
fix_divmod- Overrides:
divmod
in classRubyInteger
-
op_pow
fix_pow- Specified by:
op_pow
in classRubyInteger
-
op_pow
-
intPowTmp1
-
intPowTmp2
@Deprecated protected IRubyObject intPowTmp2(ThreadContext context, IRubyObject y, long mm, boolean negaFlg) Deprecated. -
abs
fix_abs- Specified by:
abs
in classRubyInteger
-
magnitude
fix_abs/1.9- Overrides:
magnitude
in classRubyInteger
-
op_equal
fix_equal- Specified by:
op_equal
in interfaceIRubyObject
- Specified by:
op_equal
in classRubyInteger
-
op_equal
-
op_equal
-
op_not_equal
fix_not_equal- Overrides:
op_not_equal
in classRubyBasicObject
- Parameters:
context
- thread contextother
- other object- Returns:
- false if this == other, true otherwise
-
op_not_equal
-
op_not_equal
-
op_equal_boolean
-
fastEqual
-
equals
Description copied from class:RubyObject
This override does not do a "checked" dispatch.- Overrides:
equals
in classRubyObject
- Parameters:
other
- object to compare- Returns:
- true if equals
- See Also:
-
compareTo
Description copied from class:RubyBasicObject
Compares this Ruby object with another.- Specified by:
compareTo
in interfaceComparable<IRubyObject>
- Overrides:
compareTo
in classRubyBasicObject
- Parameters:
other
- another IRubyObject- Returns:
- 0 if equal, < 0 if this is less than other, > 0 if this is greater than other
-
op_cmp
fix_cmp- Specified by:
op_cmp
in classRubyInteger
-
op_cmp
-
op_cmp
-
op_gt
fix_gt- Overrides:
op_gt
in classRubyInteger
-
op_gt
-
op_gt_boolean
-
op_ge
fix_ge- Overrides:
op_ge
in classRubyInteger
-
op_ge
-
op_ge_boolean
-
op_lt
fix_lt- Overrides:
op_lt
in classRubyInteger
-
op_lt
-
op_lt_boolean
-
op_le
fix_le- Overrides:
op_le
in classRubyInteger
-
op_le
-
op_le_boolean
-
op_neg
fix_rev- Specified by:
op_neg
in classRubyInteger
-
op_and
fix_and- Specified by:
op_and
in classRubyInteger
-
op_and
-
op_or
fix_or- Specified by:
op_or
in classRubyInteger
-
op_or
-
op_xor
fix_xor- Specified by:
op_xor
in classRubyInteger
-
op_xor
-
op_aref_subclass
rb_fix_aref- Specified by:
op_aref_subclass
in classRubyInteger
-
op_lshift
fix_lshift- Specified by:
op_lshift
in classRubyInteger
-
op_lshift
- Overrides:
op_lshift
in classRubyInteger
-
op_lshift
Deprecated. -
op_rshift
fix_rshift- Specified by:
op_rshift
in classRubyInteger
-
op_rshift
- Overrides:
op_rshift
in classRubyInteger
-
op_rshift
Deprecated. -
to_f
fix_to_f- Specified by:
to_f
in classRubyInteger
-
to_f
Deprecated.- Overrides:
to_f
in classRubyInteger
-
size
fix_size- Specified by:
size
in classRubyInteger
-
zero_p
Deprecated. -
zero_p
fix_zero_p- Specified by:
zero_p
in classRubyInteger
-
isZero
- Overrides:
isZero
in classRubyNumeric
-
nonzero_p
Description copied from class:RubyNumeric
num_nonzero_p- Overrides:
nonzero_p
in classRubyNumeric
-
succ
Description copied from class:RubyInteger
int_succ- Overrides:
succ
in classRubyInteger
-
bit_length
- Specified by:
bit_length
in classRubyInteger
-
id
Description copied from class:RubyBasicObject
rb_obj_id Return the internal id of an object.- Specified by:
id
in interfaceIRubyObject
- Overrides:
id
in classRubyBasicObject
- Returns:
- the object id
-
asJavaString
Description copied from class:RubyBasicObject
rb_to_id Will try to convert this object to a String using the Ruby "to_str" if the object isn't already a String. If this still doesn't work, will throw a Ruby TypeError.- Specified by:
asJavaString
in interfaceIRubyObject
- Overrides:
asJavaString
in classRubyBasicObject
- Returns:
- a (Java) string
-
unmarshalFrom
@Deprecated(since="10.0", forRemoval=true) public static RubyFixnum unmarshalFrom(UnmarshalStream input) throws IOException Deprecated, for removal: This API element is subject to removal in a future version.- Throws:
IOException
-
unmarshalFrom
public static RubyFixnum unmarshalFrom(ThreadContext context, RubyInputStream in, MarshalLoader input) -
convertToInteger
Description copied from class:RubyBasicObject
Tries to convert this object to a Ruby Integer using the supplied conversion method.- Specified by:
convertToInteger
in interfaceIRubyObject
- Overrides:
convertToInteger
in classRubyBasicObject
- Parameters:
method
- conversion method to use e.g. "to_i"- Returns:
- an integer representation of this
-
fdivDouble
- Specified by:
fdivDouble
in classRubyInteger
-
isNegative
Description copied from class:RubyNumeric
num_negative_p- Overrides:
isNegative
in classRubyInteger
-
isPositive
Description copied from class:RubyNumeric
num_positive_p- Overrides:
isPositive
in classRubyInteger
-
int_round_zero_p
- Overrides:
int_round_zero_p
in classRubyInteger
-
numerator
Description copied from class:RubyNumeric
numeric_numerator- Overrides:
numerator
in classRubyInteger
-
denominator
Description copied from class:RubyNumeric
numeric_denominator- Overrides:
denominator
in classRubyInteger
-
convertToRational
- Overrides:
convertToRational
in classRubyNumeric
-
remainder
Description copied from class:RubyNumeric
num_remainder- Overrides:
remainder
in classRubyInteger
-
sqrt
- Specified by:
sqrt
in classRubyInteger
-
appendIntoString
- Specified by:
appendIntoString
in interfaceAppendable
-
induced_from
Deprecated. -
taint
Deprecated.- Overrides:
taint
in classRubyBasicObject
-