Logo Search packages:      
Sourcecode: jruby1.1 version File versions

org::jruby::RubyString Class Reference

Inheritance diagram for org::jruby::RubyString:

org::jruby::RubyObject org::jruby::runtime::builtin::IRubyObject org::jruby::runtime::builtin::InstanceVariables org::jruby::runtime::builtin::InternalVariables

List of all members.


Detailed Description

Implementation of Ruby String class

Concurrency: no synchronization is required among readers, but all users must synchronize externally with writers.

Definition at line 82 of file RubyString.java.


Public Member Functions

void addFinalizer (IRubyObject finalizer)
IRubyObject anyToString ()
RubyString append (IRubyObject other)
IRubyObject as (Class javaClass)
String asJavaString ()
RubyString asString ()
void attachToObjectSpace ()
final void callInit (IRubyObject[] args, Block block)
final IRubyObject callMethod (ThreadContext context, int methodIndex, String name, IRubyObject arg)
final IRubyObject callMethod (ThreadContext context, int methodIndex, String name)
final IRubyObject callMethod (ThreadContext context, String name, IRubyObject[] args, Block block)
final IRubyObject callMethod (ThreadContext context, String name, IRubyObject[] args)
final IRubyObject callMethod (ThreadContext context, String name, IRubyObject arg)
final IRubyObject callMethod (ThreadContext context, String name)
IRubyObject callSuper (ThreadContext context, IRubyObject[] args, Block block)
IRubyObject capitalize (ThreadContext context)
IRubyObject capitalize_bang (ThreadContext context)
IRubyObject casecmp (IRubyObject other)
RubyString cat (byte ch)
RubyString cat (ByteList str)
RubyString cat (byte[] str, int beg, int len)
RubyString cat (byte[] str)
IRubyObject center (IRubyObject arg0, IRubyObject arg1)
IRubyObject center (IRubyObject arg0)
IRubyObject center (IRubyObject[] args)
IRubyObject checkArrayType ()
IRubyObject checkStringType ()
RubyString chomp (IRubyObject arg0)
RubyString chomp ()
RubyString chomp (IRubyObject[] args)
IRubyObject chomp_bang (IRubyObject arg0)
IRubyObject chomp_bang ()
IRubyObject chomp_bang (IRubyObject[] args)
IRubyObject chop (ThreadContext context)
IRubyObject chop_bang ()
RubyString concat (IRubyObject other)
RubyArray convertToArray ()
RubyFloat convertToFloat ()
RubyHash convertToHash ()
RubyInteger convertToInteger (int convertMethodIndex, String convertMethod)
RubyInteger convertToInteger ()
RubyString convertToString ()
final IRubyObject convertToType (RubyClass target, int convertMethodIndex)
IRubyObject count (IRubyObject[] args)
RubyString crypt (ThreadContext context, IRubyObject other)
synchronized Object dataGetStruct ()
synchronized void dataWrapStruct (Object obj)
IRubyObject delete (ThreadContext context, IRubyObject[] args)
IRubyObject delete_bang (IRubyObject[] args)
IRubyObject display (ThreadContext context, IRubyObject[] args)
IRubyObject doClone ()
RubyString downcase (ThreadContext context)
IRubyObject downcase_bang (ThreadContext context)
IRubyObject dump ()
IRubyObject dup ()
RubyString each_byte (ThreadContext context, Block block)
IRubyObject each_line (ThreadContext context, IRubyObject[] args, Block block)
void empty ()
RubyBoolean empty_p (ThreadContext context)
final boolean eql (IRubyObject other)
IRubyObject eql_p (IRubyObject obj)
IRubyObject equal_p (ThreadContext context, IRubyObject obj)
boolean equals (Object other)
IRubyObject evalUnder (final ThreadContext context, RubyModule under, RubyString src, String file, int line)
IRubyObject evalUnder (final ThreadContext context, RubyModule under, IRubyObject src, IRubyObject file, IRubyObject line)
IRubyObject extend (IRubyObject[] args)
IRubyObject fastGetInstanceVariable (String internedName)
IRubyObject fastGetInternalVariable (String internedName)
boolean fastHasInstanceVariable (String internedName)
boolean fastHasInternalVariable (String internedName)
IRubyObject fastSetInstanceVariable (String internedName, IRubyObject value)
void fastSetInternalVariable (String internedName, IRubyObject value)
IRubyObject freeze (ThreadContext context)
RubyBoolean frozen_p (ThreadContext context)
ByteList getByteList ()
byte[] getBytes ()
final boolean getFlag (int flag)
IRubyObject getInstanceVariable (String name)
List< Variable< IRubyObject > > getInstanceVariableList ()
List< String > getInstanceVariableNameList ()
InstanceVariables getInstanceVariables ()
IRubyObject getInternalVariable (String name)
List< Variable< IRubyObject > > getInternalVariableList ()
InternalVariables getInternalVariables ()
Class getJavaClass ()
final RubyClass getMetaClass ()
int getNativeTypeIndex ()
final Ruby getRuntime ()
RubyClass getSingletonClass ()
RubyClass getType ()
String getUnicodeValue ()
CharSequence getValue ()
int getVariableCount ()
List< Variable< IRubyObject > > getVariableList ()
Map getVariableMap ()
List< String > getVariableNameList ()
IRubyObject gsub (ThreadContext context, IRubyObject arg0, IRubyObject arg1, Block block)
IRubyObject gsub (ThreadContext context, IRubyObject arg0, Block block)
IRubyObject gsub (ThreadContext context, IRubyObject[] args, Block block)
IRubyObject gsub_bang (ThreadContext context, IRubyObject arg0, IRubyObject arg1, Block block)
IRubyObject gsub_bang (ThreadContext context, IRubyObject arg0, Block block)
IRubyObject gsub_bang (ThreadContext context, IRubyObject[] args, Block block)
RubyFixnum hash ()
int hashCode ()
boolean hasInstanceVariable (String name)
boolean hasInternalVariable (String name)
boolean hasVariables ()
IRubyObject hex (ThreadContext context)
synchronized IRubyObject id ()
synchronized IRubyObject id_deprecated ()
RubyBoolean include_p (ThreadContext context, IRubyObject obj)
IRubyObject index (ThreadContext context, IRubyObject arg0, IRubyObject arg1)
IRubyObject index (ThreadContext context, IRubyObject arg0)
IRubyObject index (ThreadContext context, IRubyObject[] args)
IRubyObject infectBy (IRubyObject obj)
IRubyObject initialize (IRubyObject arg0)
IRubyObject initialize ()
IRubyObject initialize (IRubyObject[] args, Block unusedBlock)
IRubyObject initialize_copy (IRubyObject original)
IRubyObject insert (ThreadContext context, IRubyObject indexArg, IRubyObject stringArg)
IRubyObject inspect ()
IRubyObject instance_eval (ThreadContext context, IRubyObject[] args, Block block)
IRubyObject instance_eval (ThreadContext context, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, Block block)
IRubyObject instance_eval (ThreadContext context, IRubyObject arg0, IRubyObject arg1, Block block)
IRubyObject instance_eval (ThreadContext context, IRubyObject arg0, Block block)
IRubyObject instance_eval (ThreadContext context, Block block)
IRubyObject instance_exec (ThreadContext context, IRubyObject[] args, Block block)
RubyBoolean instance_of_p (ThreadContext context, IRubyObject type)
IRubyObject instance_variable_defined_p (ThreadContext context, IRubyObject name)
IRubyObject instance_variable_get (ThreadContext context, IRubyObject name)
IRubyObject instance_variable_set (IRubyObject name, IRubyObject value)
RubyArray instance_variables (ThreadContext context)
RubySymbol intern ()
boolean isClass ()
boolean isEmpty ()
final boolean isFalse ()
boolean isFrozen ()
boolean isImmediate ()
boolean isModule ()
final boolean isNil ()
boolean isTaint ()
final boolean isTrue ()
RubyBoolean kind_of_p (ThreadContext context, IRubyObject type)
RubyFixnum length ()
IRubyObject ljust (IRubyObject arg0, IRubyObject arg1)
IRubyObject ljust (IRubyObject arg0)
IRubyObject ljust (IRubyObject[] args)
IRubyObject lstrip (ThreadContext context)
IRubyObject lstrip_bang ()
RubyClass makeMetaClass (RubyClass superClass)
final RubyString makeShared (Ruby runtime, int index, int len)
IRubyObject match (ThreadContext context, IRubyObject pattern)
IRubyObject method (IRubyObject symbol)
IRubyObject methods (ThreadContext context, IRubyObject[] args)
final void modify (int length)
final void modify ()
RubyString newString (ByteList s)
RubyString newString (CharSequence s)
IRubyObject nil_p (ThreadContext context)
IRubyObject oct (ThreadContext context)
IRubyObject op_aref (ThreadContext context, IRubyObject arg)
IRubyObject op_aref (ThreadContext context, IRubyObject arg1, IRubyObject arg2)
IRubyObject op_aref (ThreadContext context, IRubyObject[] args)
IRubyObject op_aset (ThreadContext context, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2)
IRubyObject op_aset (ThreadContext context, IRubyObject arg0, IRubyObject arg1)
IRubyObject op_aset (ThreadContext context, IRubyObject[] args)
int op_cmp (RubyString other)
IRubyObject op_cmp (ThreadContext context, IRubyObject other)
IRubyObject op_eqq (ThreadContext context, IRubyObject other)
IRubyObject op_equal (ThreadContext context, IRubyObject other)
IRubyObject op_format (ThreadContext context, IRubyObject arg)
IRubyObject op_ge (ThreadContext context, IRubyObject other)
IRubyObject op_gt (ThreadContext context, IRubyObject other)
IRubyObject op_le (ThreadContext context, IRubyObject other)
IRubyObject op_lt (ThreadContext context, IRubyObject other)
IRubyObject op_match (ThreadContext context, IRubyObject other)
IRubyObject op_match2 (ThreadContext context)
IRubyObject op_mul (ThreadContext context, IRubyObject other)
IRubyObject op_plus (ThreadContext context, IRubyObject other)
IRubyObject private_methods (ThreadContext context, IRubyObject[] args)
IRubyObject protected_methods (ThreadContext context, IRubyObject[] args)
IRubyObject public_methods (ThreadContext context, IRubyObject[] args)
IRubyObject rbClone ()
IRubyObject remove_instance_variable (ThreadContext context, IRubyObject name, Block block)
void removeFinalizers ()
IRubyObject removeInstanceVariable (String name)
IRubyObject removeInternalVariable (String name)
IRubyObject replace (int beg, int len, RubyString replaceWith)
RubyString replace (IRubyObject other)
RubyBoolean respond_to_p (IRubyObject mname, IRubyObject includePrivate)
RubyBoolean respond_to_p (IRubyObject mname)
final boolean respondsTo (String name)
RubyString reverse (ThreadContext context)
RubyString reverse_bang ()
IRubyObject rindex (ThreadContext context, IRubyObject arg0, IRubyObject arg1)
IRubyObject rindex (ThreadContext context, IRubyObject arg0)
IRubyObject rindex (ThreadContext context, IRubyObject[] args)
IRubyObject rjust (IRubyObject arg0, IRubyObject arg1)
IRubyObject rjust (IRubyObject arg0)
IRubyObject rjust (IRubyObject[] args)
IRubyObject rstrip (ThreadContext context)
IRubyObject rstrip_bang ()
IRubyObject scan (ThreadContext context, IRubyObject arg, Block block)
IRubyObject send (ThreadContext context, IRubyObject[] args, Block block)
IRubyObject send (ThreadContext context, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, Block block)
IRubyObject send (ThreadContext context, IRubyObject arg0, IRubyObject arg1, Block block)
IRubyObject send (ThreadContext context, IRubyObject arg0, Block block)
IRubyObject send (ThreadContext context, Block block)
final void setFlag (int flag, boolean set)
void setFrozen (boolean frozen)
IRubyObject setInstanceVariable (String name, IRubyObject value)
void setInternalVariable (String name, IRubyObject value)
void setMetaClass (RubyClass metaClass)
void setTaint (boolean taint)
void setValue (ByteList value)
void setValue (CharSequence value)
RubyArray singleton_methods (ThreadContext context, IRubyObject[] args)
IRubyObject slice_bang (ThreadContext context, IRubyObject arg0, IRubyObject arg1)
IRubyObject slice_bang (ThreadContext context, IRubyObject arg0)
IRubyObject slice_bang (ThreadContext context, IRubyObject[] args)
IRubyObject specificEval (ThreadContext context, RubyModule mod, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, Block block)
IRubyObject specificEval (ThreadContext context, RubyModule mod, IRubyObject arg0, IRubyObject arg1, Block block)
IRubyObject specificEval (ThreadContext context, RubyModule mod, IRubyObject arg, Block block)
IRubyObject specificEval (ThreadContext context, RubyModule mod, Block block)
IRubyObject specificEval (ThreadContext context, RubyModule mod, IRubyObject[] args, Block block)
RubyArray split (ThreadContext context, IRubyObject arg0, IRubyObject arg1)
RubyArray split (ThreadContext context, IRubyObject arg0)
RubyArray split (ThreadContext context)
RubyArray split (ThreadContext context, IRubyObject[] args)
IRubyObject squeeze (ThreadContext context, IRubyObject[] args)
IRubyObject squeeze_bang (IRubyObject[] args)
IRubyObject str_eql_p (ThreadContext context, IRubyObject other)
final RubyString strDup (Ruby runtime)
final RubyString strDup ()
IRubyObject strip (ThreadContext context)
IRubyObject strip_bang ()
IRubyObject sub (ThreadContext context, IRubyObject arg0, IRubyObject arg1, Block block)
IRubyObject sub (ThreadContext context, IRubyObject arg0, Block block)
IRubyObject sub (ThreadContext context, IRubyObject[] args, Block block)
IRubyObject sub_bang (ThreadContext context, IRubyObject arg0, IRubyObject arg1, Block block)
IRubyObject sub_bang (ThreadContext context, IRubyObject arg0, Block block)
IRubyObject sub_bang (ThreadContext context, IRubyObject[] args, Block block)
IRubyObject substr (Ruby runtime, int beg, int len)
IRubyObject substr (int beg, int len)
IRubyObject succ (ThreadContext context)
IRubyObject succ_bang ()
RubyInteger sum (IRubyObject[] args)
RubyString swapcase (ThreadContext context)
IRubyObject swapcase_bang (ThreadContext context)
void syncVariables (List< Variable< IRubyObject >> variables)
IRubyObject taint (ThreadContext context)
RubyBoolean tainted_p (ThreadContext context)
RubyArray to_a ()
IRubyObject to_c (ThreadContext context)
IRubyObject to_f ()
IRubyObject to_i (IRubyObject arg0)
IRubyObject to_i ()
IRubyObject to_i (IRubyObject[] args)
IRubyObject to_java ()
IRubyObject to_r (ThreadContext context)
IRubyObject to_s ()
RubySymbol to_sym ()
String toString ()
IRubyObject tr (ThreadContext context, IRubyObject src, IRubyObject repl)
IRubyObject tr_bang (IRubyObject src, IRubyObject repl)
IRubyObject tr_s (ThreadContext context, IRubyObject src, IRubyObject repl)
IRubyObject tr_s_bang (IRubyObject src, IRubyObject repl)
RubyClass type ()
RubyClass type_deprecated ()
RubyArray unpack (IRubyObject obj)
IRubyObject untaint (ThreadContext context)
RubyString upcase (ThreadContext context)
IRubyObject upcase_bang (ThreadContext context)
IRubyObject upto (ThreadContext context, IRubyObject str, boolean excl, Block block)
IRubyObject upto (ThreadContext context, IRubyObject str, Block block)

Static Public Member Functions

static String byteListToString (ByteList bytes)
static String bytesToString (byte[] bytes)
static String bytesToString (byte[] bytes, int beg, int len)
static RubyClass createObjectClass (Ruby runtime, RubyClass objectClass)
static RubyClass createStringClass (Ruby runtime)
static boolean isAlnum (int c)
static boolean isDigit (int c)
static boolean isLetter (int c)
static boolean isLower (int c)
static boolean isPrint (int c)
static boolean isUpper (int c)
static RubyString newEmptyString (Ruby runtime, RubyClass metaClass)
static RubyString newEmptyString (Ruby runtime)
static RubyString newInstance (IRubyObject recv, IRubyObject[] args, Block block)
static RubyString newString (Ruby runtime, ByteList bytes)
static RubyString newString (Ruby runtime, byte[] bytes, int start, int length)
static RubyString newString (Ruby runtime, byte[] bytes)
static RubyString newString (Ruby runtime, RubyClass clazz, CharSequence str)
static RubyString newString (Ruby runtime, CharSequence str)
static RubyString newStringLight (Ruby runtime, ByteList bytes)
static RubyString newStringShared (Ruby runtime, byte[] bytes, int start, int length)
static RubyString newStringShared (Ruby runtime, RubyClass clazz, ByteList bytes)
static RubyString newStringShared (Ruby runtime, ByteList bytes)
static RubyString newStringShared (Ruby runtime, RubyString orig)
static RubyString newUnicodeString (Ruby runtime, String str)
static RubyString objAsString (ThreadContext context, IRubyObject obj)
static void puts (Object obj)
static byte[] stringToBytes (String string)
static RubyString stringValue (IRubyObject object)
static RubyString unmarshalFrom (UnmarshalStream input) throws java.io.IOException

Static Public Attributes

static final int ALL_F = -1
static final int FALSE_F = 1 << 0
static final int FL_USHIFT = 4
static final int FROZEN_F = 1 << 2
static final IRubyObject NEVER = new RubyObject()
static final int NIL_F = 1 << 1
static final IRubyObject[] NULL_ARRAY = new IRubyObject[0]
static final ObjectAllocator OBJECT_ALLOCATOR
static final int TAINTED_F = 1 << 3
static final IRubyObject UNDEF = new RubyObject()
static final int USER0_F = (1<<(FL_USHIFT+0))
static final int USER1_F = (1<<(FL_USHIFT+1))
static final int USER2_F = (1<<(FL_USHIFT+2))
static final int USER3_F = (1<<(FL_USHIFT+3))
static final int USER4_F = (1<<(FL_USHIFT+4))
static final int USER5_F = (1<<(FL_USHIFT+5))
static final int USER6_F = (1<<(FL_USHIFT+6))
static final int USER7_F = (1<<(FL_USHIFT+7))

Protected Member Functions

void checkFrozen ()
void copySpecialInstanceVariables (IRubyObject clone)
void ensureInstanceVariablesSettable ()
RubyClass getSingletonClassClone ()
final void testFrozen (String message)
String validateInstanceVariable (String name)
boolean variableTableContains (String name)
boolean variableTableFastContains (String internedName)
IRubyObject variableTableFastFetch (String internedName)
IRubyObject variableTableFastStore (String internedName, IRubyObject value)
IRubyObject variableTableFetch (String name)
Map variableTableGetMap (Map map)
Map variableTableGetMap ()
int variableTableGetSize ()
VariableTableEntry[] variableTableGetTable ()
synchronized IRubyObject variableTableReadLocked (VariableTableEntry entry)
final VariableTableEntry[] variableTableRehash ()
IRubyObject variableTableRemove (String name)
IRubyObject variableTableStore (String name, IRubyObject value)
void variableTableSync (List< Variable< IRubyObject >> vars)

Static Protected Member Functions

static boolean eqlInternal (final ThreadContext context, final IRubyObject that, final IRubyObject other)
static boolean equalInternal (final ThreadContext context, final IRubyObject that, final IRubyObject other)
static final boolean isRubyVariable (String name)

Protected Attributes

transient Object dataStruct
int flags
transient RubyClass metaClass
transient volatile
VariableTableEntry[] 
variableTable
transient int variableTableSize
transient int variableTableThreshold

Static Protected Attributes

static final String ERR_INSECURE_SET_INST_VAR = "Insecure: can't modify instance variable"
static final int VARIABLE_TABLE_DEFAULT_CAPACITY = 8
static final VariableTableEntry[] VARIABLE_TABLE_EMPTY_TABLE = new VariableTableEntry[0]
static final float VARIABLE_TABLE_LOAD_FACTOR = 0.75f
static final int VARIABLE_TABLE_MAXIMUM_CAPACITY = 1 << 30

Package Functions

final void modifyCheck ()
final RubyString strDup (Ruby runtime, RubyClass clazz)
final RubyString strDup (RubyClass clazz)

Static Package Functions

static RubyString inspect (ThreadContext context, IRubyObject object)

Private Member Functions

RubyArray awkSplit (boolean limit, int lim, int i)
IRubyObject chompBangCommon (IRubyObject rsObj)
Encoding encodingCheck (RubyRegexp pattern)
final void frozenCheck ()
final RubyRegexp getPattern (IRubyObject obj, boolean quote)
final IRubyObject gsub (ThreadContext context, IRubyObject arg0, IRubyObject arg1, Block block, final boolean bang)
final IRubyObject gsub (ThreadContext context, IRubyObject arg0, Block block, final boolean bang)
IRubyObject gsubCommon (Regex regex, ThreadContext context, final boolean bang, final boolean iter, RubyRegexp rubyRegex, Block block, IRubyObject repl, boolean tainted)
IRubyObject indexCommon (int pos, IRubyObject sub, ThreadContext context) throws RaiseException
ByteList inspectIntoByteList (boolean ignoreKCode)
boolean isEVStr (int i, int length)
final IRubyObject justify (IRubyObject arg0, IRubyObject arg1, char jflag)
final IRubyObject justify (IRubyObject arg0, char jflag)
IRubyObject justifyCommon (int width, char jflag, int flen, byte[] fbuf, int f, Ruby runtime, IRubyObject pad)
final void modifyCheck (byte[] b, int len)
IRubyObject rindexCommon (final IRubyObject sub, int pos, ThreadContext context) throws RaiseException
 RubyString (Ruby runtime, RubyClass rubyClass, ByteList value, boolean objectSpace)
 RubyString (Ruby runtime, RubyClass rubyClass, ByteList value)
 RubyString (Ruby runtime, RubyClass rubyClass, byte[] value)
 RubyString (Ruby runtime, RubyClass rubyClass, CharSequence value)
IRubyObject scanOnce (RubyRegexp regex, Matcher matcher, int range)
IRubyObject scanOnceNG (RubyRegexp regex, Matcher matcher, int range)
final void setup_table (boolean[]table, boolean init)
RubyArray split (ThreadContext context, IRubyObject pat, boolean limit, int lim, int i)
RubyArray splitCommon (IRubyObject spat, final boolean limit, final int lim, final int i, ThreadContext context)
int strIndex (RubyString sub, int offset)
int strRindex (RubyString sub, int pos)
IRubyObject subBangCommon (Regex regex, ThreadContext context, final boolean iter, RubyRegexp rubyRegex, Block block, RubyString repl, boolean tainted)
void subpatSet (ThreadContext context, RubyRegexp regexp, int nth, IRubyObject repl)
final IRubyObject tr_trans (IRubyObject src, IRubyObject repl, boolean sflag)
final int trnext (TR t)
final void view (int index, int len)
final void view (byte[]bytes)
final void view (ByteList bytes)

Private Attributes

volatile int shareLevel = SHARE_LEVEL_NONE
ByteList value

Static Private Attributes

static final ASCIIEncoding ASCII = ASCIIEncoding.INSTANCE
static final int SHARE_LEVEL_BUFFER = 1
static final int SHARE_LEVEL_BYTELIST = 2
static final int SHARE_LEVEL_NONE = 0
static final ByteList SPACE_BYTELIST = new ByteList(ByteList.plain(" "))
static ObjectAllocator STRING_ALLOCATOR
static final int TRANS_SIZE = 256

Classes

class  TR

The documentation for this class was generated from the following file:

Generated by  Doxygen 1.6.0   Back to index