Top Inners Fields Constructors Methods
org.jruby

public Class RubyBoolean

extends RubyObject
implements Constantizable, Appendable
Class Inheritance
All Implemented Interfaces
org.jruby.Appendable, org.jruby.compiler.Constantizable
Known Direct Subclasses
org.jruby.RubyBoolean.False, org.jruby.RubyBoolean.True
Annotations
@JRubyClass
name:TrueClass, FalseClass
Imports
org.jcodings.specific.USASCIIEncoding, org.jruby.anno.JRubyClass, .JRubyMethod, org.jruby.compiler.Constantizable, org.jruby.runtime.ClassIndex, .ThreadContext, org.jruby.runtime.builtin.IRubyObject, org.jruby.runtime.opto.OptoFactory, org.jruby.util.ByteList

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
public static class

Field Summary

Modifier and TypeField and Description
private final transient Object
public static final ByteList
private final int
private final RubyString
public static final ByteList
Inherited from org.jruby.RubyObject:
IVAR_INSPECTING_OBJECT_ALLOCATOROBJECT_ALLOCATORREIFYING_OBJECT_ALLOCATOR

Constructor Summary

AccessConstructor and Description
pack-priv
RubyBoolean(Ruby runtime, boolean value)

Method Summary

Modifier and TypeMethod and Description
public void
public Object
public static void
public static void
public Class<?>
getJavaClass()

Overrides org.jruby.RubyBasicObject.getJavaClass.

Implements org.jruby.runtime.builtin.IRubyObject.getJavaClass.

Will return the Java interface that most closely can represent this object, when working through Java integration translations.

public ClassIndex
getNativeClassIndex()

Overrides org.jruby.RubyObject.getNativeClassIndex.

Implements org.jruby.runtime.marshal.CoreObjectType.getNativeClassIndex.

This is overridden in the other concrete Java builtins to provide a fast way to determine what type they are.

public RubyFixnum
hash(ThreadContext
the current thread context
context
)

Overrides org.jruby.RubyBasicObject.hash.

Will return the hash code of this object.

public int
hashCode()

Overrides org.jruby.RubyObject.hashCode.

This override does not do "checked" dispatch since Object usually has #hash defined.

public RubyFixnum
id()

Overrides org.jruby.RubyBasicObject.id.

Implements org.jruby.runtime.builtin.IRubyObject.id.

rb_obj_id Return the internal id of an object.

public boolean
isImmediate()

Overrides org.jruby.RubyBasicObject.isImmediate.

Implements org.jruby.runtime.builtin.IRubyObject.isImmediate.

Is object immediate (def: Fixnum, Symbol, true, false, nil?).

public void
marshalTo(MarshalStream output)
Deprecated for removal since 10.0.

public static RubyBoolean
newBoolean(Ruby runtime, boolean value)
Deprecated

public static RubyBoolean
newBoolean(ThreadContext context, boolean value)
Deprecated

public RubyClass
singletonClass(ThreadContext
the current thread context
context
)

Overrides org.jruby.RubyBasicObject.singletonClass.

Overrides default org.jruby.runtime.builtin.IRubyObject.singletonClass.

Will either return the existing singleton class for this object, or create a new one and return that.

public IRubyObject
taint(ThreadContext context)

Overrides org.jruby.RubyBasicObject.taint.

Deprecated

Inherited from org.jruby.RubyObject:
attachToObjectSpacecallInitcallInitcallInitcallInitcallInitcallInitcallInitcallInitcallInitcallInitconvertToTypedigdig1dig2eqlInternalequalInternalequalsfinishObjectClassinspectop_eqqputsspecificEvaltoRubyStringtoString

Field Detail

constantback to summary
private final transient Object constant
FALSE_BYTESback to summary
public static final ByteList FALSE_BYTES
hashCodeback to summary
private final int hashCode
toSback to summary
private final RubyString toS
TRUE_BYTESback to summary
public static final ByteList TRUE_BYTES

Constructor Detail

RubyBooleanback to summary
pack-priv RubyBoolean(Ruby runtime, boolean value)

Method Detail

appendIntoStringback to summary
public void appendIntoString(RubyString target)

Implements org.jruby.Appendable.appendIntoString.

Annotations
@Override
constantback to summary
public Object constant()

Implements org.jruby.compiler.Constantizable.constant.

Annotations
@Override
See Also
org.jruby.compiler.Constantizable
finishFalseClassback to summary
public static void finishFalseClass(ThreadContext context, RubyClass False)
finishTrueClassback to summary
public static void finishTrueClass(ThreadContext context, RubyClass True)
getJavaClassback to summary
public Class<?> getJavaClass()

Overrides org.jruby.RubyBasicObject.getJavaClass.

Implements org.jruby.runtime.builtin.IRubyObject.getJavaClass.

Doc from org.jruby.RubyBasicObject.getJavaClass.

Will return the Java interface that most closely can represent this object, when working through Java integration translations.

Returns:Class<?>

the true Java class of this (Ruby) object

Annotations
@Override
getNativeClassIndexback to summary
public ClassIndex getNativeClassIndex()

Overrides org.jruby.RubyObject.getNativeClassIndex.

Implements org.jruby.runtime.marshal.CoreObjectType.getNativeClassIndex.

Doc from org.jruby.RubyObject.getNativeClassIndex.

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

Returns:ClassIndex

Doc from org.jruby.runtime.marshal.CoreObjectType.getNativeClassIndex.

the ClassIndex of the native type this object was constructed from

Annotations
@Override
hashback to summary
public RubyFixnum hash(ThreadContext context)

Overrides org.jruby.RubyBasicObject.hash.

Doc from org.jruby.RubyBasicObject.hash.

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.

Parameters
context:ThreadContext

the current thread context

Returns:RubyFixnum

the hash value

Annotations
@JRubyMethod
name:hash
hashCodeback to summary
public int hashCode()

Overrides org.jruby.RubyObject.hashCode.

Doc from org.jruby.RubyObject.hashCode.

This override does not do "checked" dispatch since Object usually has #hash defined.

Returns:int

the hash code

Annotations
@Override
idback to summary
public RubyFixnum id()

Overrides org.jruby.RubyBasicObject.id.

Implements org.jruby.runtime.builtin.IRubyObject.id.

Doc from org.jruby.RubyBasicObject.id.

rb_obj_id Return the internal id of an object.

Returns:RubyFixnum

Doc from org.jruby.runtime.builtin.IRubyObject.id.

the object id

Annotations
@Override
isImmediateback to summary
public boolean isImmediate()

Overrides org.jruby.RubyBasicObject.isImmediate.

Implements org.jruby.runtime.builtin.IRubyObject.isImmediate.

Doc from org.jruby.RubyBasicObject.isImmediate.

Is object immediate (def: Fixnum, Symbol, true, false, nil?).

Returns:boolean

Doc from org.jruby.runtime.builtin.IRubyObject.isImmediate.

boolean

Annotations
@Override
marshalToback to summary
public void marshalTo(MarshalStream output) throws IOException

Deprecated

for removal since 10.0.

Annotations
@Deprecated
since:10.0
forRemoval:true
@SuppressWarnings:removal
newBooleanback to summary
public static RubyBoolean newBoolean(Ruby runtime, boolean value)

Deprecated

Annotations
@Deprecated
newBooleanback to summary
public static RubyBoolean newBoolean(ThreadContext context, boolean value)

Deprecated

Annotations
@Deprecated
singletonClassback to summary
public RubyClass singletonClass(ThreadContext context)

Overrides org.jruby.RubyBasicObject.singletonClass.

Overrides default org.jruby.runtime.builtin.IRubyObject.singletonClass.

Doc from org.jruby.RubyBasicObject.singletonClass.

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.

Parameters
context:ThreadContext

the current thread context

Returns:RubyClass

the singleton of this type

taintback to summary
public IRubyObject taint(ThreadContext context)

Overrides org.jruby.RubyBasicObject.taint.

Deprecated

Annotations
@Deprecated
@Override
org.jruby back to summary

public Class RubyBoolean.False

extends RubyBoolean
Class Inheritance

Field Summary

Inherited from org.jruby.RubyBoolean:
FALSE_BYTESTRUE_BYTES

Constructor Summary

AccessConstructor and Description
pack-priv
False(Ruby runtime)

Method Summary

Modifier and TypeMethod and Description
public static IRubyObject
public static IRubyObject
public static RubyString
false_to_s(ThreadContext context, IRubyObject fals)
Deprecated

public static IRubyObject
public RubyString
inspect()

Overrides org.jruby.RubyBasicObject.inspect.

Implements org.jruby.runtime.builtin.IRubyObject.inspect.

Deprecated since 10.0.

RubyMethod inspect.

public RubyString
inspect(ThreadContext context)

Overrides org.jruby.RubyBasicObject.inspect.

Overrides default org.jruby.runtime.builtin.IRubyObject.inspect.

Returns a string containing a human-readable representation of obj.

public <T> T
toJava(Class<T>
The target type to which the object should be converted.
target
)

Overrides org.jruby.RubyBasicObject.toJava.

Implements org.jruby.runtime.builtin.IRubyObject.toJava.

Convert the object to the specified Java class, if possible.

Inherited from org.jruby.RubyBoolean:
appendIntoStringconstantfinishFalseClassfinishTrueClassgetJavaClassgetNativeClassIndexhashhashCodeidisImmediatemarshalTonewBooleannewBooleansingletonClasstaint

Constructor Detail

Falseback to summary
pack-priv False(Ruby runtime)

Method Detail

false_andback to summary
public static IRubyObject false_and(IRubyObject fals, IRubyObject oth)
Annotations
@JRubyMethod
name:&
false_orback to summary
public static IRubyObject false_or(ThreadContext context, IRubyObject fals, IRubyObject oth)
Annotations
@JRubyMethod
name:|
false_to_sback to summary
public static RubyString false_to_s(ThreadContext context, IRubyObject fals)

Deprecated

Annotations
@Deprecated
false_xorback to summary
public static IRubyObject false_xor(ThreadContext context, IRubyObject fals, IRubyObject oth)
Annotations
@JRubyMethod
name:^
inspectback to summary
public RubyString inspect()

Overrides org.jruby.RubyBasicObject.inspect.

Implements org.jruby.runtime.builtin.IRubyObject.inspect.

Doc from org.jruby.runtime.builtin.IRubyObject.inspect.

Deprecated

since 10.0.

RubyMethod inspect.

Returns:RubyString

String

Annotations
@Deprecated
since:10.0
inspectback to summary
public RubyString inspect(ThreadContext context)

Overrides org.jruby.RubyBasicObject.inspect.

Overrides default org.jruby.runtime.builtin.IRubyObject.inspect.

Doc from org.jruby.RubyBasicObject.inspect.

Returns a string containing a human-readable representation of obj. If not overridden, uses the to_s method to generate the string. [ 1, 2, 3..4, 'five' ].inspect #=> "[1, 2, 3..4, \"five\"]" Time.new.inspect #=> "Wed Apr 09 08:54:39 CDT 2003"

Annotations
@JRubyMethod
name:to_s
alias:inspect
toJavaback to summary
public <T> T toJava(Class<T> target)

Overrides org.jruby.RubyBasicObject.toJava.

Implements org.jruby.runtime.builtin.IRubyObject.toJava.

Doc from org.jruby.runtime.builtin.IRubyObject.toJava.

Convert the object to the specified Java class, if possible.

Parameters
<T>
type
target:Class<T>

The target type to which the object should be converted.

Returns:T

java type

Annotations
@Override
org.jruby back to summary

public Class RubyBoolean.True

extends RubyBoolean
Class Inheritance

Field Summary

Inherited from org.jruby.RubyBoolean:
FALSE_BYTESTRUE_BYTES

Constructor Summary

AccessConstructor and Description
pack-priv
True(Ruby runtime)

Method Summary

Modifier and TypeMethod and Description
public RubyString
inspect()

Overrides org.jruby.RubyBasicObject.inspect.

Implements org.jruby.runtime.builtin.IRubyObject.inspect.

Deprecated since 10.0.

RubyMethod inspect.

public RubyString
inspect(ThreadContext context)

Overrides org.jruby.RubyBasicObject.inspect.

Overrides default org.jruby.runtime.builtin.IRubyObject.inspect.

Returns a string containing a human-readable representation of obj.

public <T> T
toJava(Class<T>
The target type to which the object should be converted.
target
)

Overrides org.jruby.RubyBasicObject.toJava.

Implements org.jruby.runtime.builtin.IRubyObject.toJava.

Convert the object to the specified Java class, if possible.

public static IRubyObject
public static IRubyObject
public static RubyString
true_to_s(ThreadContext context, IRubyObject tru)
Deprecated since 10.0.

public static IRubyObject
Inherited from org.jruby.RubyBoolean:
appendIntoStringconstantfinishFalseClassfinishTrueClassgetJavaClassgetNativeClassIndexhashhashCodeidisImmediatemarshalTonewBooleannewBooleansingletonClasstaint

Constructor Detail

Trueback to summary
pack-priv True(Ruby runtime)

Method Detail

inspectback to summary
public RubyString inspect()

Overrides org.jruby.RubyBasicObject.inspect.

Implements org.jruby.runtime.builtin.IRubyObject.inspect.

Doc from org.jruby.runtime.builtin.IRubyObject.inspect.

Deprecated

since 10.0.

RubyMethod inspect.

Returns:RubyString

String

Annotations
@Deprecated
since:10.0
inspectback to summary
public RubyString inspect(ThreadContext context)

Overrides org.jruby.RubyBasicObject.inspect.

Overrides default org.jruby.runtime.builtin.IRubyObject.inspect.

Doc from org.jruby.RubyBasicObject.inspect.

Returns a string containing a human-readable representation of obj. If not overridden, uses the to_s method to generate the string. [ 1, 2, 3..4, 'five' ].inspect #=> "[1, 2, 3..4, \"five\"]" Time.new.inspect #=> "Wed Apr 09 08:54:39 CDT 2003"

Annotations
@JRubyMethod
name:to_s
alias:inspect
toJavaback to summary
public <T> T toJava(Class<T> target)

Overrides org.jruby.RubyBasicObject.toJava.

Implements org.jruby.runtime.builtin.IRubyObject.toJava.

Doc from org.jruby.runtime.builtin.IRubyObject.toJava.

Convert the object to the specified Java class, if possible.

Parameters
<T>
type
target:Class<T>

The target type to which the object should be converted.

Returns:T

java type

Annotations
@Override
true_andback to summary
public static IRubyObject true_and(ThreadContext context, IRubyObject tru, IRubyObject oth)
Annotations
@JRubyMethod
name:&
true_orback to summary
public static IRubyObject true_or(IRubyObject tru, IRubyObject oth)
Annotations
@JRubyMethod
name:|
true_to_sback to summary
public static RubyString true_to_s(ThreadContext context, IRubyObject tru)

Deprecated

since 10.0.

Annotations
@Deprecated
since:10.0
true_xorback to summary
public static IRubyObject true_xor(ThreadContext context, IRubyObject tru, IRubyObject oth)
Annotations
@JRubyMethod
name:^