org.jruby
Class RubyInteger

java.lang.Object
  extended by org.jruby.RubyObject
      extended by org.jruby.RubyNumeric
          extended by org.jruby.RubyInteger
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, InstanceVariables, InternalVariables, IRubyObject, CoreObjectType
Direct Known Subclasses:
RubyBignum, RubyFixnum

public abstract class RubyInteger
extends RubyNumeric

Implementation of the Integer class.

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.Finalizer, RubyObject.ObjectMethods, RubyObject.VariableTableEntry
 
Field Summary
 
Fields inherited from class org.jruby.RubyNumeric
DBL_EPSILON, NUMERIC_ALLOCATOR
 
Fields inherited from class org.jruby.RubyObject
ALL_F, ERR_INSECURE_SET_INST_VAR, FALSE_F, FL_USHIFT, flags, FROZEN_F, metaClass, NEVER, NIL_F, OBJECT_ALLOCATOR, TAINTED_F, UNDEF, USER0_F, USER1_F, USER2_F, USER3_F, USER4_F, USER5_F, USER6_F, USER7_F, VARIABLE_TABLE_DEFAULT_CAPACITY, VARIABLE_TABLE_EMPTY_TABLE, VARIABLE_TABLE_LOAD_FACTOR, VARIABLE_TABLE_MAXIMUM_CAPACITY, variableTable, variableTableSize, variableTableThreshold
 
Fields inherited from interface org.jruby.runtime.builtin.IRubyObject
NULL_ARRAY
 
Constructor Summary
RubyInteger(Ruby runtime, RubyClass rubyClass)
           
RubyInteger(Ruby runtime, RubyClass rubyClass, boolean useObjectSpace)
           
 
Method Summary
 RubyString chr()
          int_chr
 RubyInteger convertToInteger()
          Tries to convert this object to a Ruby Integer using the "to_int" method.
static RubyClass createIntegerClass(Ruby runtime)
           
 IRubyObject downto(ThreadContext context, IRubyObject to, Block block)
          int_downto
static RubyBoolean even_p(ThreadContext context, IRubyObject recv)
           
static IRubyObject induced_from(ThreadContext context, IRubyObject recv, IRubyObject other)
          rb_int_induced_from
 IRubyObject integer_p()
          int_int_p
static RubyBoolean odd_p(ThreadContext context, IRubyObject recv)
           
static IRubyObject pred(ThreadContext context, IRubyObject recv)
           
 IRubyObject succ(ThreadContext context)
          int_succ
 IRubyObject times(ThreadContext context, Block block)
           
 RubyInteger to_i()
          int_to_i
protected  RubyFloat toFloat()
           
 IRubyObject upto(ThreadContext context, IRubyObject to, Block block)
          int_upto
 
Methods inherited from class org.jruby.RubyNumeric
abs, asNumeric, callCoerced, callCoerced, ceil, checkInt, coerce, coerceBin, coerceBody, coerceCmp, coerceRelOp, createNumericClass, dbl_cmp, dbl2num, div, divmod, doCoerce, eql_p, fix2int, fix2long, floor, getCoerced, getDoubleValue, getLongValue, initialize_copy, int2fix, modulo, newNumeric, nonzero_p, num2chr, num2dbl, num2fix, num2int, num2long, op_cmp, op_num_equal, op_uminus, op_uplus, quo, remainder, round, sadded, step, step, step, str2fnum, str2fnum, str2inum, str2inum, to_int, truncate, zero_p
 
Methods inherited from class org.jruby.RubyObject
addFinalizer, anyToString, as, asJavaString, asString, attachToObjectSpace, callInit, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callSuper, checkArrayType, checkFrozen, checkStringType, convertToArray, convertToFloat, convertToHash, convertToInteger, convertToString, convertToType, copySpecialInstanceVariables, createObjectClass, dataGetStruct, dataWrapStruct, display, dup, ensureInstanceVariablesSettable, eql_p, eql, eqlInternal, equal_p, equalInternal, equals, evalUnder, evalUnder, extend, fastGetInstanceVariable, fastGetInternalVariable, fastHasInstanceVariable, fastHasInternalVariable, fastSetInstanceVariable, fastSetInternalVariable, freeze, frozen_p, getFlag, getInstanceVariable, getInstanceVariableList, getInstanceVariableNameList, getInstanceVariables, getInternalVariable, getInternalVariableList, getInternalVariables, getJavaClass, getMetaClass, getNativeTypeIndex, getRuntime, getSingletonClass, getSingletonClassClone, getType, getVariableCount, getVariableList, getVariableMap, getVariableNameList, hash, hashCode, hasInstanceVariable, hasInternalVariable, hasVariables, id_deprecated, id, infectBy, 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, isClass, isFalse, isFrozen, isImmediate, isModule, isNil, isRubyVariable, isTaint, isTrue, kind_of_p, makeMetaClass, method, methods, nil_p, op_eqq, op_equal, op_match, private_methods, protected_methods, public_methods, puts, rbClone, remove_instance_variable, removeFinalizers, removeInstanceVariable, removeInternalVariable, respond_to_p, respond_to_p, respondsTo, send, setFlag, setFrozen, setInstanceVariable, setInternalVariable, setMetaClass, setTaint, singleton_methods, specificEval, specificEval, specificEval, specificEval, specificEval, syncVariables, taint, tainted_p, testFrozen, to_a, to_java, to_s, toString, type_deprecated, type, untaint, validateInstanceVariable, variableTableContains, variableTableFastContains, variableTableFastFetch, variableTableFastStore, variableTableFetch, variableTableGetMap, variableTableGetMap, variableTableGetSize, variableTableGetTable, variableTableReadLocked, variableTableRehash, variableTableRemove, variableTableStore, variableTableSync
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RubyInteger

public RubyInteger(Ruby runtime,
                   RubyClass rubyClass)

RubyInteger

public RubyInteger(Ruby runtime,
                   RubyClass rubyClass,
                   boolean useObjectSpace)
Method Detail

createIntegerClass

public static RubyClass createIntegerClass(Ruby runtime)

convertToInteger

public RubyInteger convertToInteger()
Description copied from class: RubyObject
Tries to convert this object to a Ruby Integer using the "to_int" method.

Specified by:
convertToInteger in interface IRubyObject
Overrides:
convertToInteger in class RubyObject
Returns:

toFloat

protected RubyFloat toFloat()

integer_p

public IRubyObject integer_p()
int_int_p

Overrides:
integer_p in class RubyNumeric

upto

public IRubyObject upto(ThreadContext context,
                        IRubyObject to,
                        Block block)
int_upto


downto

public IRubyObject downto(ThreadContext context,
                          IRubyObject to,
                          Block block)
int_downto


times

public IRubyObject times(ThreadContext context,
                         Block block)

succ

public IRubyObject succ(ThreadContext context)
int_succ


chr

public RubyString chr()
int_chr


to_i

public RubyInteger to_i()
int_to_i


odd_p

public static RubyBoolean odd_p(ThreadContext context,
                                IRubyObject recv)

even_p

public static RubyBoolean even_p(ThreadContext context,
                                 IRubyObject recv)

pred

public static IRubyObject pred(ThreadContext context,
                               IRubyObject recv)

induced_from

public static IRubyObject induced_from(ThreadContext context,
                                       IRubyObject recv,
                                       IRubyObject other)
rb_int_induced_from



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