public class RubySymbol extends RubyObject implements MarshalEncoding, Constantizable
| Modifier and Type | Class and Description |
|---|---|
static class |
RubySymbol.SymbolTable |
RubyObject.DataRubyBasicObject.Finalizer| Modifier and Type | Field and Description |
|---|---|
static long |
symbolHashSeedK0 |
FIELD_ALLOCATED_CLASSES, FIELD_ALLOCATORS, IVAR_INSPECTING_OBJECT_ALLOCATOR, OBJECT_ALLOCATOR, OBJECT_VAR0_ALLOCATOR, OBJECT_VAR1_ALLOCATOR, OBJECT_VAR2_ALLOCATOR, OBJECT_VAR3_ALLOCATOR, OBJECT_VAR4_ALLOCATOR, OBJECT_VAR5_ALLOCATOR, OBJECT_VAR6_ALLOCATOR, OBJECT_VAR7_ALLOCATOR, OBJECT_VAR8_ALLOCATOR, OBJECT_VAR9_ALLOCATOR, REIFYING_OBJECT_ALLOCATORALL_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, UNTRUST_F, 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, varTableStampNULL_ARRAY| Modifier and Type | Method and Description |
|---|---|
static IRubyObject |
all_symbols(IRubyObject recv)
Deprecated.
|
static IRubyObject |
all_symbols(ThreadContext context,
IRubyObject recv) |
String |
asJavaString()
rb_to_id
|
void |
associateEncoding(org.jcodings.Encoding encoding)
RubySymbol is created by passing in a String and bytes are extracted from that.
|
IRubyObject |
capitalize(ThreadContext context) |
IRubyObject |
casecmp(ThreadContext context,
IRubyObject other) |
Object |
constant() |
static RubyClass |
createSymbolClass(Ruby runtime) |
IRubyObject |
downcase(ThreadContext context) |
IRubyObject |
empty_p(ThreadContext context) |
IRubyObject |
encoding(ThreadContext context) |
boolean |
eql(IRubyObject other)
short circuit for Symbol key comparison
|
boolean |
equals(Object other)
This method is just a wrapper around the Ruby "==" method,
provided so that RubyObjects can be used as keys in the Java
HashMap object underlying RubyHash.
|
int |
getId() |
org.jcodings.Encoding |
getMarshalEncoding() |
ClassIndex |
getNativeClassIndex()
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.
|
static RubySymbol |
getSymbolLong(Ruby runtime,
long id) |
RubyFixnum |
hash()
Deprecated.
|
RubyFixnum |
hash(ThreadContext context) |
int |
hashCode()
Override the Object#hashCode method to make sure that the Ruby
hash is actually used as the hashcode for Ruby objects.
|
IRubyObject |
id2name() |
IRubyObject |
id2name(ThreadContext context) |
IRubyObject |
inspect()
Deprecated.
|
IRubyObject |
inspect(ThreadContext context) |
IRubyObject |
inspect19(ThreadContext context) |
boolean |
isImmediate()
Is object immediate (def: Fixnum, Symbol, true, false, nil?).
|
IRubyObject |
length() |
static RubySymbol |
newSymbol(Ruby runtime,
IRubyObject name) |
static RubySymbol |
newSymbol(Ruby runtime,
String name) |
static RubySymbol |
newSymbol(Ruby runtime,
String name,
org.jcodings.Encoding encoding) |
static String |
objectToSymbolString(IRubyObject object)
Properly stringify an object for the current "raw bytes" representation
of a symbol.
|
IRubyObject |
op_aref(ThreadContext context,
IRubyObject arg) |
IRubyObject |
op_aref(ThreadContext context,
IRubyObject arg1,
IRubyObject arg2) |
IRubyObject |
op_cmp(ThreadContext context,
IRubyObject other) |
IRubyObject |
op_eqq(ThreadContext context,
IRubyObject other)
rb_equal
The Ruby "===" method is used by default in case/when
statements.
|
IRubyObject |
op_equal(ThreadContext context,
IRubyObject other) |
IRubyObject |
op_match19(ThreadContext context,
IRubyObject other) |
boolean |
shouldMarshalEncoding() |
IRubyObject |
succ(ThreadContext context) |
IRubyObject |
swapcase(ThreadContext context) |
static org.jruby.util.ByteList |
symbolBytesFromString(Ruby runtime,
String internedSymbol) |
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. |
IRubyObject |
to_proc(ThreadContext context) |
IRubyObject |
to_s()
rb_any_to_s
call-seq:
obj.to_s => string
Returns a string representing obj.
|
IRubyObject |
to_s(ThreadContext context) |
IRubyObject |
to_sym() |
IRubyObject |
to_sym19() |
Object |
toJava(Class target)
Convert the object to the specified Java class, if possible.
|
String |
toString()
The default toString method is just a wrapper that calls the
Ruby "to_s" method.
|
static RubySymbol |
unmarshalFrom(UnmarshalStream input) |
IRubyObject |
upcase(ThreadContext context) |
attachToObjectSpace, callInit, callInit, callInit, callInit, callInit, callInit, callInit, callInit, callInit, callInit, convertToType, createObjectClass, eqlInternal, equalInternal, initialize, initialize, inspect, puts, specificEvaladdFinalizer, anyToString, asString, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callSuper, checkArrayType, checkCallMethod, checkFrozen, checkStringType, checkStringType19, compareTo, convertToArray, convertToFloat, convertToHash, convertToInteger, convertToInteger, convertToInteger, convertToString, copyInstanceVariablesInto, copySpecialInstanceVariables, createBasicObjectClass, dataGetStruct, dataGetStructChecked, dataWrapStruct, display, dup, ensureInstanceVariablesSettable, eql_p, equal_p, equal_p19, evalUnder, extend, fastGetInstanceVariable, fastGetInternalVariable, fastHasInstanceVariable, fastHasInternalVariable, fastSetInstanceVariable, fastSetInternalVariable, freeze, frozen_p, getFFIHandle, getFlag, getInstanceEvalClass, getInstanceVariable, getInstanceVariableList, getInstanceVariableNameList, getInstanceVariables, getInternalVariable, getInternalVariables, getJavaClass, getMetaClass, getNativeHandle, getNativeTypeIndex, getObjectId, getRuntime, getSingletonClassClone, getType, getVariable, getVariableCount, getVariableList, getVariableNameList, hashyInspect, hasInstanceVariable, hasInternalVariable, hasVariables, id, infectBy, initialize_copy, initialize19, inspectHashCode, instance_eval, instance_eval, instance_eval, instance_eval, instance_eval19, instance_eval19, instance_eval19, instance_eval19, instance_exec, instance_exec19, instance_of_p, instance_variable_defined_p, instance_variable_get, instance_variable_set, instance_variables, instance_variables19, isBuiltin, isClass, isFalse, isFrozen, isModule, isNil, isSpecialConst, isTaint, isTrue, isUntrusted, kind_of_p, makeMetaClass, method_missing19, method, method19, methods, methods, methods19, nil_p, OBJ_INIT_COPY, objInitCopy, op_equal_19, op_match, op_not_equal, op_not_match, op_not, private_methods, private_methods19, protected_methods, protected_methods19, public_methods, public_methods19, rbClone, rbInspect, remove_instance_variable, removeFinalizers, removeInstanceVariable, removeInternalVariable, respond_to_p, respond_to_p, respond_to_p19, respond_to_p19, respondsTo, respondsToMissing, respondsToMissing, send, send, send, send, send, send19, send19, send19, send19, setFFIHandle, setFlag, setFrozen, setInstanceVariable, setInternalVariable, setMetaClass, setNativeHandle, setTaint, setUntrusted, setVariable, singleton_method_added19, singleton_method_removed19, singleton_method_undefined19, singleton_methods, specificEval, specificEval, specificEval, specificEval, syncVariables, syncVariables, taint, tainted_p, testFrozen, testFrozen, to_a, trust, type_deprecated, type, untaint, untrust, untrusted_p, validateInstanceVariable, variableTableContains, variableTableFastContains, variableTableFastFetch, variableTableFastStore, variableTableFetch, variableTableRemove, variableTableStore, variableTableSync, yieldUnder, yieldUnderpublic static final long symbolHashSeedK0
public ClassIndex getNativeClassIndex()
RubyObjectgetNativeClassIndex in interface CoreObjectTypegetNativeClassIndex in class RubyObjectClassIndexpublic String asJavaString()
asJavaString in interface IRubyObjectasJavaString in class RubyBasicObjectpublic String toString()
RubyObjecttoString in class RubyObjectpublic void associateEncoding(org.jcodings.Encoding encoding)
public final boolean eql(IRubyObject other)
eql in interface IRubyObjecteql in class RubyBasicObjectpublic boolean isImmediate()
RubyBasicObjectisImmediate in interface IRubyObjectisImmediate in class RubyBasicObjectpublic RubyClass getSingletonClass()
RubyBasicObjectgetSingletonClass in interface IRubyObjectgetSingletonClass in class RubyBasicObjectpublic static RubySymbol getSymbolLong(Ruby runtime, long id)
public static RubySymbol newSymbol(Ruby runtime, IRubyObject name)
public static RubySymbol newSymbol(Ruby runtime, String name)
public static RubySymbol newSymbol(Ruby runtime, String name, org.jcodings.Encoding encoding)
public Object constant()
constant in interface ConstantizableConstantizable@Deprecated public IRubyObject inspect()
RubyBasicObjectto_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"inspect in interface IRubyObjectinspect in class RubyBasicObjectpublic IRubyObject inspect(ThreadContext context)
public IRubyObject inspect19(ThreadContext context)
public IRubyObject to_s()
RubyBasicObjectto_s prints the object's class and an encoding of the
object id. As a special case, the top-level object that is the
initial execution context of Ruby programs returns ``main.''to_s in class RubyBasicObjectpublic IRubyObject to_s(ThreadContext context)
public IRubyObject id2name()
public IRubyObject id2name(ThreadContext context)
public IRubyObject op_eqq(ThreadContext context, IRubyObject other)
RubyObjectop_eqq in interface IRubyObjectop_eqq in class RubyObjectpublic IRubyObject op_equal(ThreadContext context, IRubyObject other)
op_equal in interface IRubyObjectop_equal in class RubyBasicObject@Deprecated public RubyFixnum hash()
RubyBasicObjecthash in class RubyBasicObjectpublic RubyFixnum hash(ThreadContext context)
public int hashCode()
RubyObjecthashCode in class RubyObjectpublic int getId()
public boolean equals(Object other)
RubyObjectequals in class RubyObjectpublic IRubyObject to_sym()
public IRubyObject to_sym19()
public IRubyObject taint(ThreadContext context)
RubyBasicObject$SAFE level is
set appropriately, many method calls which might alter the running
programs environment will refuse to accept tainted strings.taint in class RubyBasicObjectpublic IRubyObject succ(ThreadContext context)
public IRubyObject op_cmp(ThreadContext context, IRubyObject other)
op_cmp in class RubyBasicObjectpublic IRubyObject casecmp(ThreadContext context, IRubyObject other)
public IRubyObject op_match19(ThreadContext context, IRubyObject other)
op_match19 in class RubyBasicObjectpublic IRubyObject op_aref(ThreadContext context, IRubyObject arg)
public IRubyObject op_aref(ThreadContext context, IRubyObject arg1, IRubyObject arg2)
public IRubyObject length()
public IRubyObject empty_p(ThreadContext context)
public IRubyObject upcase(ThreadContext context)
public IRubyObject downcase(ThreadContext context)
public IRubyObject capitalize(ThreadContext context)
public IRubyObject swapcase(ThreadContext context)
public IRubyObject encoding(ThreadContext context)
public IRubyObject to_proc(ThreadContext context)
public static IRubyObject all_symbols(ThreadContext context, IRubyObject recv)
@Deprecated public static IRubyObject all_symbols(IRubyObject recv)
public static RubySymbol unmarshalFrom(UnmarshalStream input) throws IOException
IOExceptionpublic Object toJava(Class target)
IRubyObjecttoJava in interface IRubyObjecttoJava in class RubyBasicObjecttarget - The target type to which the object should be converted.IRubyObject.toJava(java.lang.Class)public static org.jruby.util.ByteList symbolBytesFromString(Ruby runtime, String internedSymbol)
public boolean shouldMarshalEncoding()
shouldMarshalEncoding in interface MarshalEncodingpublic org.jcodings.Encoding getMarshalEncoding()
getMarshalEncoding in interface MarshalEncodingpublic static String objectToSymbolString(IRubyObject object)
object - the object to symbolifyCopyright © 2001-2015 JRuby. All Rights Reserved.