org.jruby
Class RubyBoolean
java.lang.Object
org.jruby.RubyBasicObject
org.jruby.RubyObject
org.jruby.RubyBoolean
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable, InstanceVariables, InternalVariables, IRubyObject, CoreObjectType
public class RubyBoolean
- extends RubyObject
- Author:
- jpetersen
- See Also:
- Serialized Form
Fields inherited from class org.jruby.RubyBasicObject |
ALL_F, dataStruct, ERR_INSECURE_SET_INST_VAR, FALSE_F, FL_USHIFT, flags, FROZEN_F, metaClass, NEVER, NIL_F, 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 |
Method Summary |
static RubyClass |
createFalseClass(Ruby runtime)
|
static RubyClass |
createTrueClass(Ruby runtime)
|
IRubyObject |
freeze(ThreadContext context)
rb_obj_freeze
call-seq:
obj.freeze => obj
Prevents further modifications to obj. |
java.lang.Class<?> |
getJavaClass()
Will return the Java interface that most closely can represent
this object, when working through JAva integration
translations. |
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 return that. |
RubyFixnum |
id()
rb_obj_id
Return the internal id of an object. |
boolean |
isImmediate()
Is object immediate (def: Fixnum, Symbol, true, false, nil?). |
void |
marshalTo(MarshalStream output)
|
static RubyBoolean |
newBoolean(Ruby runtime,
boolean value)
|
IRubyObject |
taint(ThreadContext context)
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. |
Methods inherited from class org.jruby.RubyObject |
as, attachToObjectSpace, callInit, checkFrozen, convertToType, createObjectClass, display, dup, eql_p, eqlInternal, equal_p, equalInternal, equals, evalUnder, evalUnder, extend, frozen_p, hash, hashCode, id_deprecated, initialize_copy, 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, kind_of_p, method, methods, nil_p, op_eqq, op_equal, op_match, private_methods, protected_methods, public_methods, puts, rbClone, remove_instance_variable, respond_to_p, respond_to_p, send, send, send, send, send, singleton_methods, singleton_methods19, singletonMethods, specificEval, specificEval, specificEval, specificEval, specificEval, tainted_p, to_a, to_java, to_s, toString, type_deprecated, type, untaint, validateInstanceVariable |
Methods inherited from class org.jruby.RubyBasicObject |
addFinalizer, anyToString, asJavaString, asString, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callSuper, checkArrayType, checkStringType, convertToArray, convertToFloat, convertToHash, convertToInteger, convertToInteger, convertToInteger, convertToString, copyInstanceVariablesInto, copySpecialInstanceVariables, createBasicObjectClass, dataGetStruct, dataWrapStruct, ensureInstanceVariablesSettable, eql, fastGetInstanceVariable, fastGetInternalVariable, fastHasInstanceVariable, fastHasInternalVariable, fastSetInstanceVariable, fastSetInternalVariable, getFlag, getInstanceVariable, getInstanceVariableList, getInstanceVariableNameList, getInstanceVariables, getInternalVariable, getInternalVariableList, getInternalVariables, getMetaClass, getRuntime, getSingletonClassClone, getType, getVariableCount, getVariableList, getVariableMap, getVariableNameList, hasInstanceVariable, hasInternalVariable, hasVariables, infectBy, isClass, isFalse, isFrozen, isModule, isNil, isRubyVariable, isTaint, isTrue, makeMetaClass, op_not_equal, op_not, removeFinalizers, removeInstanceVariable, removeInternalVariable, respondsTo, setFlag, setFrozen, setInstanceVariable, setInternalVariable, setMetaClass, setTaint, syncVariables, taint, testFrozen, 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 |
RubyBoolean
public RubyBoolean(Ruby runtime,
boolean value)
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:
RubyBasicObject
- Is object immediate (def: Fixnum, Symbol, true, false, nil?).
- Specified by:
isImmediate
in interface IRubyObject
- Overrides:
isImmediate
in class RubyBasicObject
- Returns:
getSingletonClass
public RubyClass getSingletonClass()
- Description copied from class:
RubyBasicObject
- 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 return that.
- Specified by:
getSingletonClass
in interface IRubyObject
- Overrides:
getSingletonClass
in class RubyBasicObject
- Returns:
- RubyClass
getJavaClass
public java.lang.Class<?> 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 interface IRubyObject
- Overrides:
getJavaClass
in class RubyBasicObject
- Returns:
- Class
createFalseClass
public static RubyClass createFalseClass(Ruby runtime)
createTrueClass
public static RubyClass createTrueClass(Ruby runtime)
newBoolean
public static RubyBoolean newBoolean(Ruby runtime,
boolean value)
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(ThreadContext context)
- 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(ThreadContext context)
- 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
marshalTo
public void marshalTo(MarshalStream output)
throws java.io.IOException
- Throws:
java.io.IOException
Copyright © 2002-2007 JRuby Team. All Rights Reserved.