org.jruby
Class RubyNil

java.lang.Object
  extended by org.jruby.RubyObject
      extended by org.jruby.RubyNil
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, InstanceVariables, InternalVariables, IRubyObject, CoreObjectType

public class RubyNil
extends RubyObject

Author:
jpetersen
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class org.jruby.RubyObject
RubyObject.Finalizer, RubyObject.ObjectMethods, RubyObject.VariableTableEntry
 
Field Summary
static ObjectAllocator NIL_ALLOCATOR
           
 
Fields inherited from class org.jruby.RubyObject
ALL_F, ERR_INSECURE_SET_INST_VAR, FALSE_F, FL_USHIFT, flags, FROZEN_F, metaClass, metaClassName, 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
RubyNil(Ruby runtime)
           
 
Method Summary
static RubyClass createNilClass(Ruby runtime)
           
 IRubyObject freeze()
          rb_obj_freeze call-seq: obj.freeze => obj Prevents further modifications to obj.
 int getNativeTypeIndex()
          This is overridden in the other concrete Java builtins to provide a fast way to determine what type they are.
 RubyClass getSingletonClass()
          rb_singleton_class Note: this method is specialized for RubyFixnum, RubySymbol, RubyNil and RubyBoolean Will either return the existing singleton class for this object, or create a new one and rutning that.
 RubyFixnum id()
          rb_obj_id Return the internal id of an object.
static RubyString inspect(IRubyObject recv)
          nil_inspect
 boolean isImmediate()
          Is object immediate (def: Fixnum, Symbol, true, false, nil?).
 IRubyObject nil_p()
          rb_false call_seq: nil.nil? => true .nil? => false Only the object nil responds true to nil?.
static RubyBoolean op_and(IRubyObject recv, IRubyObject obj)
          nil_and
static RubyBoolean op_or(IRubyObject recv, IRubyObject obj)
          nil_or
static RubyBoolean op_xor(IRubyObject recv, IRubyObject obj)
          nil_xor
 IRubyObject taint()
          rb_obj_taint call-seq: obj.taint -> obj Marks obj as tainted---if the $SAFE level is set appropriately, many method calls which might alter the running programs environment will refuse to accept tainted strings.
static RubyArray to_a(IRubyObject recv)
          nil_to_a
static RubyFloat to_f(IRubyObject recv)
          nil_to_f
static RubyFixnum to_i(IRubyObject recv)
          nil_to_i
static RubyString to_s(IRubyObject recv)
          nil_to_s
static RubyClass type(IRubyObject recv)
          nil_type
 
Methods inherited from class org.jruby.RubyObject
addFinalizer, anyToString, asJavaString, asString, attachToObjectSpace, callInit, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callSuper, checkArrayType, checkFrozen, checkStringType, convertToArray, convertToFloat, convertToHash, convertToInteger, convertToInteger, convertToString, convertToType, copySpecialInstanceVariables, createObjectClass, dataGetStruct, dataWrapStruct, display, dup, ensureInstanceVariablesSettable, eql_p, eql, eqlInternal, equal_p, equalInternal, equals, evalUnder, extend, fastGetInstanceVariable, fastGetInternalVariable, fastHasInstanceVariable, fastHasInternalVariable, fastSetInstanceVariable, fastSetInternalVariable, frozen_p, getFlag, getInstanceVariable, getInstanceVariableList, getInstanceVariableNameList, getInstanceVariables, getInternalVariable, getInternalVariableList, getInternalVariables, getJavaClass, getMetaClass, getRuntime, getSingletonClassClone, getType, getVariableCount, getVariableList, getVariableMap, getVariableNameList, hash, hashCode, hasInstanceVariable, hasInternalVariable, hasVariables, id_deprecated, infectBy, initialize_copy, initialize, inspect, instance_eval, instance_exec, instance_of_p, instance_variable_defined_p, instance_variable_get, instance_variable_set, instance_variables, isClass, isFalse, isFrozen, isModule, isNil, isRubyVariable, isTaint, isTrue, kind_of_p, makeMetaClass, method, methods, 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, syncVariables, tainted_p, testFrozen, to_a, 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
 

Field Detail

NIL_ALLOCATOR

public static final ObjectAllocator NIL_ALLOCATOR
Constructor Detail

RubyNil

public RubyNil(Ruby runtime)
Method Detail

createNilClass

public static RubyClass createNilClass(Ruby runtime)

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. Will generally return a value from org.jruby.runtime.ClassIndex

Specified by:
getNativeTypeIndex in interface CoreObjectType
Overrides:
getNativeTypeIndex in class RubyObject
Returns:
the ClassIndex of the native type this object was constructed from
See Also:
org.jruby.runtime.ClassInde

isImmediate

public boolean isImmediate()
Description copied from class: RubyObject
Is object immediate (def: Fixnum, Symbol, true, false, nil?).

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

getSingletonClass

public RubyClass getSingletonClass()
Description copied from class: RubyObject
rb_singleton_class Note: this method is specialized for RubyFixnum, RubySymbol, RubyNil and RubyBoolean Will either return the existing singleton class for this object, or create a new one and rutning that.

Specified by:
getSingletonClass in interface IRubyObject
Overrides:
getSingletonClass in class RubyObject
Returns:
RubyClass

to_i

public static RubyFixnum to_i(IRubyObject recv)
nil_to_i


to_f

public static RubyFloat to_f(IRubyObject recv)
nil_to_f


to_s

public static RubyString to_s(IRubyObject recv)
nil_to_s


to_a

public static RubyArray to_a(IRubyObject recv)
nil_to_a


inspect

public static RubyString inspect(IRubyObject recv)
nil_inspect


type

public static RubyClass type(IRubyObject recv)
nil_type


op_and

public static RubyBoolean op_and(IRubyObject recv,
                                 IRubyObject obj)
nil_and


op_or

public static RubyBoolean op_or(IRubyObject recv,
                                IRubyObject obj)
nil_or


op_xor

public static RubyBoolean op_xor(IRubyObject recv,
                                 IRubyObject obj)
nil_xor


nil_p

public IRubyObject nil_p()
Description copied from class: RubyObject
rb_false call_seq: nil.nil? => true .nil? => false Only the object nil responds true to nil?.

Overrides:
nil_p in class RubyObject

id

public RubyFixnum id()
Description copied from class: RubyObject
rb_obj_id Return the internal id of an object. FIXME: Should this be renamed to match its ruby name?

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

taint

public IRubyObject taint()
Description copied from class: RubyObject
rb_obj_taint call-seq: obj.taint -> obj Marks obj as tainted---if the $SAFE level is set appropriately, many method calls which might alter the running programs environment will refuse to accept tainted strings.

Overrides:
taint in class RubyObject

freeze

public IRubyObject freeze()
Description copied from class: RubyObject
rb_obj_freeze call-seq: obj.freeze => obj Prevents further modifications to obj. A TypeError will be raised if modification is attempted. There is no way to unfreeze a frozen object. See also Object#frozen?. a = [ "a", "b", "c" ] a.freeze a << "z" produces: prog.rb:3:in `<<': can't modify frozen array (TypeError) from prog.rb:3

Overrides:
freeze in class RubyObject


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