|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jruby.RubyBasicObject
org.jruby.RubyObject
org.jruby.RubySymbol
public class RubySymbol
Represents a Ruby symbol (e.g. :bar)
Nested Class Summary | |
---|---|
static class |
RubySymbol.SymbolTable
|
Nested classes/interfaces inherited from class org.jruby.RubyObject |
---|
RubyObject.Data, RubyObject.ObjectMethods |
Nested classes/interfaces inherited from class org.jruby.RubyBasicObject |
---|
RubyBasicObject.BasicObjectMethods, RubyBasicObject.Finalizer |
Field Summary |
---|
Fields inherited from class org.jruby.RubyObject |
---|
OBJECT_ALLOCATOR |
Fields inherited from class org.jruby.RubyBasicObject |
---|
ALL_F, COMPARE_BY_IDENTITY_F, ERR_INSECURE_SET_INST_VAR, FALSE_F, FL_USHIFT, flags, FROZEN_F, metaClass, NEVER, NIL_F, TAINTED_F, UNDEF, UNTRUSTED_F, USER0_F, USER1_F, USER2_F, USER3_F, USER4_F, USER5_F, USER6_F, USER7_F |
Fields inherited from interface org.jruby.runtime.builtin.IRubyObject |
---|
NULL_ARRAY |
Method Summary | |
---|---|
static IRubyObject |
all_symbols(IRubyObject recv)
Deprecated. |
static IRubyObject |
all_symbols(ThreadContext context,
IRubyObject recv)
|
java.lang.String |
asJavaString()
rb_to_id |
IRubyObject |
capitalize(ThreadContext context)
|
IRubyObject |
casecmp(ThreadContext context,
IRubyObject other)
|
RubyString |
convertToString()
Tries to convert this object to a Ruby String using the "to_str" method. |
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(java.lang.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()
|
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. |
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()
Deprecated. |
IRubyObject |
inspect19(ThreadContext context)
|
boolean |
isImmediate()
Is object immediate (def: Fixnum, Symbol, true, false, nil?). |
IRubyObject |
length()
|
static RubySymbol |
newSymbol(Ruby runtime,
java.lang.String name)
|
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_match19(ThreadContext context,
IRubyObject other)
|
IRubyObject |
succ(ThreadContext context)
|
IRubyObject |
swapcase(ThreadContext context)
|
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. |
RubyFixnum |
to_i()
Deprecated. |
RubyFixnum |
to_i(ThreadContext context)
|
RubyFixnum |
to_int()
Deprecated. |
RubyFixnum |
to_int(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()
|
java.lang.Object |
toJava(java.lang.Class target)
Convert the object to the specified Java class, if possible. |
java.lang.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)
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public static RubyClass createSymbolClass(Ruby runtime)
public int getNativeTypeIndex()
RubyObject
getNativeTypeIndex
in interface CoreObjectType
getNativeTypeIndex
in class RubyObject
org.jruby.runtime.ClassInde
public java.lang.String asJavaString()
asJavaString
in interface IRubyObject
asJavaString
in class RubyBasicObject
public RubyString convertToString()
RubyBasicObject
convertToString
in interface IRubyObject
convertToString
in class RubyBasicObject
public java.lang.String toString()
RubyObject
toString
in class RubyObject
public final boolean eql(IRubyObject other)
eql
in interface IRubyObject
eql
in class RubyBasicObject
public boolean isImmediate()
RubyBasicObject
isImmediate
in interface IRubyObject
isImmediate
in class RubyBasicObject
public RubyClass getSingletonClass()
RubyBasicObject
getSingletonClass
in interface IRubyObject
getSingletonClass
in class RubyBasicObject
public static RubySymbol getSymbolLong(Ruby runtime, long id)
public static RubySymbol newSymbol(Ruby runtime, java.lang.String name)
@Deprecated public RubyFixnum to_i()
public RubyFixnum to_i(ThreadContext context)
@Deprecated public RubyFixnum to_int()
public RubyFixnum to_int(ThreadContext context)
@Deprecated public IRubyObject inspect()
RubyObject
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"
inspect
in interface IRubyObject
inspect
in class RubyObject
public IRubyObject inspect(ThreadContext context)
@Deprecated public IRubyObject inspect19()
public IRubyObject inspect19(ThreadContext context)
public IRubyObject to_s()
RubyObject
to_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 RubyObject
public IRubyObject to_s(ThreadContext context)
public IRubyObject id2name()
public IRubyObject id2name(ThreadContext context)
public IRubyObject op_eqq(ThreadContext context, IRubyObject other)
RubyObject
op_eqq
in interface IRubyObject
op_eqq
in class RubyObject
@Deprecated public RubyFixnum hash()
RubyObject
hash
in class RubyObject
public RubyFixnum hash(ThreadContext context)
public int hashCode()
RubyObject
hashCode
in class RubyObject
public int getId()
public boolean equals(java.lang.Object other)
RubyObject
equals
in class RubyObject
public IRubyObject to_sym()
public IRubyObject taint(ThreadContext context)
RubyObject
$SAFE
level is
set appropriately, many method calls which might alter the running
programs environment will refuse to accept tainted strings.
taint
in class RubyObject
public IRubyObject succ(ThreadContext context)
public IRubyObject op_cmp(ThreadContext context, IRubyObject other)
public IRubyObject casecmp(ThreadContext context, IRubyObject other)
public IRubyObject op_match19(ThreadContext context, IRubyObject other)
public 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 static IRubyObject all_symbols(ThreadContext context, IRubyObject recv)
@Deprecated public static IRubyObject all_symbols(IRubyObject recv)
public static RubySymbol unmarshalFrom(UnmarshalStream input) throws java.io.IOException
java.io.IOException
public java.lang.Object toJava(java.lang.Class target)
IRubyObject
toJava
in interface IRubyObject
toJava
in class RubyBasicObject
target
- The target type to which the object should be converted.IRubyObject.toJava
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |