org.jruby
Class RubyString

java.lang.Object
  extended by org.jruby.RubyObject
      extended by org.jruby.RubyString
All Implemented Interfaces:
java.lang.Cloneable, IRubyObject

public class RubyString
extends RubyObject

Author:
jpetersen

Nested Class Summary
static class RubyString.JavaCrypt
           
 
Nested classes/interfaces inherited from class org.jruby.RubyObject
RubyObject.Finalizer
 
Field Summary
static byte AREF_SWITCHVALUE
           
static byte ASET_SWITCHVALUE
           
static byte EMPTY_P_SWITCHVALUE
           
static byte EQQ_SWITCHVALUE
           
static byte EQUALEQUAL_SWITCHVALUE
           
static byte HASH_SWITCHVALUE
           
static byte INSPECT_SWITCHVALUE
           
static byte LENGTH_SWITCHVALUE
           
static byte MATCH_SWITCHVALUE
           
static byte NIL_P_SWITCHVALUE
           
static byte OP_GE_SWITCHVALUE
           
static byte OP_GT_SWITCHVALUE
           
static byte OP_LE_SWITCHVALUE
           
static byte OP_LSHIFT_SWITCHVALUE
           
static byte OP_LT_SWITCHVALUE
           
static byte OP_PLUS_SWITCHVALUE
           
static byte OP_SPACESHIP_SWITCHVALUE
           
static byte OP_TIMES_SWITCHVALUE
           
static byte TO_I_SWITCHVALUE
           
static byte TO_S_SWITCHVALUE
           
static byte TO_STR_SWITCHVALUE
           
static byte TO_SYM_SWITCHVALUE
           
 
Fields inherited from class org.jruby.RubyObject
instanceVariables, isTrue, metaClass, NEVER, OBJECT_ALLOCATOR
 
Fields inherited from interface org.jruby.runtime.builtin.IRubyObject
NULL_ARRAY
 
Method Summary
 RubyString append(IRubyObject other)
          rb_str_append
 IRubyObject aref(IRubyObject[] args)
          rb_str_aref, rb_str_aref_m
 IRubyObject aset(IRubyObject[] args)
          rb_str_aset, rb_str_aset_m
 java.lang.String asSymbol()
          rb_to_id
static java.lang.String byteListToString(ByteList bytes)
           
static java.lang.String bytesToString(byte[] bytes)
           
static java.lang.String bytesToString(byte[] bytes, int beg, int len)
           
 IRubyObject callMethod(ThreadContext context, RubyModule rubyclass, int methodIndex, java.lang.String name, IRubyObject[] args, CallType callType, Block block)
           
 IRubyObject capitalize_bang()
          rb_str_capitalize_bang
 IRubyObject capitalize()
          rb_str_capitalize
 IRubyObject casecmp(IRubyObject other)
           
 RubyString cat(byte ch)
           
 RubyString cat(byte[] str)
           
 RubyString cat(byte[] str, int beg, int len)
           
 RubyString cat(ByteList str)
           
 IRubyObject center(IRubyObject[] args)
           
 IRubyObject checkStringType()
          rb_check_string_type
 IRubyObject chomp_bang(IRubyObject[] args)
          rb_str_chomp_bang In the common case, removes CR and LF characters in various ways depending on the value of the optional args[0].
 RubyString chomp(IRubyObject[] args)
          rb_str_chop
 IRubyObject chop_bang()
          rb_str_chop_bang
 IRubyObject chop()
           
 int cmp(RubyString other)
          rb_str_cmp
 RubyString concat(IRubyObject other)
          rb_str_concat
 RubyString convertToString()
           
 IRubyObject count(IRubyObject[] args)
          rb_str_count
static RubyClass createStringClass(Ruby runtime)
           
 RubyString crypt(IRubyObject other)
          rb_str_crypt
 IRubyObject delete_bang(IRubyObject[] args)
          rb_str_delete_bang
 IRubyObject delete(IRubyObject[] args)
          rb_str_delete
 IRubyObject doClone()
           
 IRubyObject downcase_bang()
          rb_str_downcase_bang
 RubyString downcase()
          rb_str_downcase
 IRubyObject dump()
          rb_str_dump
 RubyString each_byte(Block block)
          rb_str_each_byte
 IRubyObject each_line(IRubyObject[] args, Block block)
          rb_str_each_line
 RubyBoolean empty()
          rb_str_empty
 IRubyObject eql_p(IRubyObject other)
           
 boolean eql(IRubyObject other)
          short circuit for String key comparison
 IRubyObject equal(IRubyObject other)
          rb_equal
 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.
 IRubyObject format(IRubyObject arg)
           
 ByteList getByteList()
           
 byte[] getBytes()
           
 java.lang.Class getJavaClass()
          RubyMethod getJavaClass.
 int getNativeTypeIndex()
          This is overridden in the other concrete Java builtins to provide a fast way to determine what type they are.
 java.lang.String getUnicodeValue()
           
 java.lang.CharSequence getValue()
           
 IRubyObject gsub_bang(IRubyObject[] args, Block block)
          rb_str_gsub_bang
 IRubyObject gsub(IRubyObject[] args, Block block)
          rb_str_gsub
 RubyFixnum hash()
           
 int hashCode()
           
 IRubyObject hex()
          rb_str_hex
 RubyBoolean include(IRubyObject obj)
          rb_str_include
 IRubyObject index(IRubyObject[] args)
          rb_str_index_m
 IRubyObject initialize(IRubyObject[] args, Block unusedBlock)
           
 IRubyObject insert(IRubyObject indexArg, IRubyObject stringArg)
           
 IRubyObject inspect()
          rb_str_inspect
 RubySymbol intern()
          rb_str_intern
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)
           
 RubyFixnum length()
          rb_str_length
 IRubyObject ljust(IRubyObject[] args)
          rb_str_ljust
 IRubyObject lstrip_bang()
          rb_str_lstrip_bang
 IRubyObject lstrip()
          rb_str_lstrip
 RubyString makeShared(int index, int len)
           
 IRubyObject match(IRubyObject other)
          rb_str_match
 IRubyObject match2()
          rb_str_match2
 IRubyObject match3(IRubyObject pattern)
          String#match(pattern)
 void modify()
          rb_str_modify
 void modify(int length)
           
static RubyString newInstance(IRubyObject recv, IRubyObject[] args, Block block)
          rb_str_s_new
 RubyString newString(ByteList s)
          Create a new String which uses the same Ruby runtime and the same class like this String.
 RubyString newString(java.lang.CharSequence s)
          Create a new String which uses the same Ruby runtime and the same class like this String.
static RubyString newString(Ruby runtime, byte[] bytes)
           
static RubyString newString(Ruby runtime, byte[] bytes, int start, int length)
           
static RubyString newString(Ruby runtime, ByteList bytes)
           
static RubyString newString(Ruby runtime, java.lang.CharSequence str)
          rb_str_new2
static RubyString newString(Ruby runtime, RubyClass clazz, java.lang.CharSequence str)
           
static RubyString newStringShared(Ruby runtime, ByteList bytes)
           
static RubyString newStringShared(Ruby runtime, RubyString orig)
           
static RubyString newUnicodeString(Ruby runtime, java.lang.String str)
           
static RubyString objAsString(IRubyObject obj)
          rb_obj_as_string
 IRubyObject oct()
          rb_str_oct
 IRubyObject op_cmp(IRubyObject other)
           
 IRubyObject op_ge(IRubyObject other)
           
 IRubyObject op_gt(IRubyObject other)
           
 IRubyObject op_le(IRubyObject other)
           
 IRubyObject op_lt(IRubyObject other)
           
 IRubyObject op_mul(IRubyObject other)
           
 IRubyObject op_plus(IRubyObject other)
           
 IRubyObject replace(int beg, int len, RubyString replaceWith)
           
 RubyString replace(IRubyObject other)
          rb_str_replace_m
 RubyString reverse_bang()
           
 RubyString reverse()
           
 IRubyObject rindex(IRubyObject[] args)
          rb_str_rindex_m
 IRubyObject rjust(IRubyObject[] args)
          rb_str_rjust
 IRubyObject rstrip_bang()
          rb_str_rstrip_bang
 IRubyObject rstrip()
          rb_str_rstrip
 IRubyObject scan(IRubyObject arg, Block block)
          rb_str_scan
 void setUnicodeValue(java.lang.String newValue)
           
 void setValue(ByteList value)
           
 void setValue(java.lang.CharSequence value)
          Mutator for internal string representation.
 IRubyObject slice_bang(IRubyObject[] args)
          rb_str_slice_bang
 RubyArray split(IRubyObject[] args)
          rb_str_split_m
 IRubyObject squeeze_bang(IRubyObject[] args)
          rb_str_squeeze_bang
 IRubyObject squeeze(IRubyObject[] args)
          rb_str_squeeze
 RubyString strDup()
          rb_str_dup
static byte[] stringToBytes(java.lang.String string)
           
static RubyString stringValue(IRubyObject object)
           
 IRubyObject strip_bang()
          rb_str_strip_bang
 IRubyObject strip()
          rb_str_strip
 IRubyObject sub_bang(IRubyObject[] args, Block block)
          rb_str_sub_bang
 IRubyObject sub(IRubyObject[] args, Block block)
          rb_str_sub
 IRubyObject substr(int beg, int len)
           
 IRubyObject succ_bang()
           
 IRubyObject succ()
           
 RubyInteger sum(IRubyObject[] args)
           
 IRubyObject swapcase_bang()
          rb_str_swapcase_bang
 RubyString swapcase()
          rb_str_swapcase
 IRubyObject to_f()
          rb_str_to_f
 IRubyObject to_i(IRubyObject[] args)
          rb_str_to_i
 IRubyObject to_s()
           
 RubySymbol to_sym()
           
 java.lang.String toString()
           
static byte[] toUTF(java.lang.String string)
           
 IRubyObject tr_bang(IRubyObject src, IRubyObject repl)
          rb_str_tr_bang
 IRubyObject tr_s_bang(IRubyObject src, IRubyObject repl)
          rb_str_tr_s_bang
 IRubyObject tr_s(IRubyObject src, IRubyObject repl)
          rb_str_tr_s
 IRubyObject tr(IRubyObject src, IRubyObject repl)
          rb_str_tr
static RubyString unmarshalFrom(UnmarshalStream input)
           
 RubyArray unpack(IRubyObject obj)
           
 IRubyObject upcase_bang()
          rb_str_upcase_bang
 RubyString upcase()
          rb_str_upcase
 IRubyObject upto(IRubyObject str, Block block)
          rb_str_upto_m
 IRubyObject upto(IRubyObject str, boolean excl, Block block)
           
 
Methods inherited from class org.jruby.RubyObject
addFinalizer, anyToString, asString, attachToObjectSpace, callInit, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethodMissing, callMethodMissing, callSuper, checkArrayType, checkFrozen, compilerCallMethod, compilerCallMethodWithIndex, convertToArray, convertToFloat, convertToHash, convertToInteger, convertToType, convertToType, convertToType, convertToTypeWithCheck, createObjectClass, dataGetStruct, dataWrapStruct, display, dup, eqlInternal, equalInternal, evalSimple, evalUnder, evalWithBinding, extend, freeze, frozen, getInstanceVariable, getInstanceVariables, getInstanceVariablesSnapshot, getMetaClass, getRuntime, getSingletonClass, getSingletonClassClone, getType, id_deprecated, id, infectBy, inherited, initCopy, initialize_copy, instance_eval, instance_exec, instance_of, instance_variable_get, instance_variable_set, instance_variables, instanceVariableNames, isFalse, isFrozen, isImmediate, isKindOf, isNil, isSingleton, isTaint, isTrue, kind_of, makeMetaClass, method, methods, nil_p, obj_equal, private_methods, protected_methods, public_methods, puts, rbClone, remove_instance_variable, removeFinalizers, removeInstanceVariable, respond_to, respondsTo, safeGetInstanceVariables, safeHasInstanceVariables, send, setFrozen, setInstanceVariable, setInstanceVariable, setInstanceVariables, setMetaClass, setTaint, singleton_methods, specificEval, taint, tainted, testFrozen, trueFalseNil, trueFalseNil, type_deprecated, type, untaint
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

OP_PLUS_SWITCHVALUE

public static final byte OP_PLUS_SWITCHVALUE
See Also:
Constant Field Values

OP_LT_SWITCHVALUE

public static final byte OP_LT_SWITCHVALUE
See Also:
Constant Field Values

AREF_SWITCHVALUE

public static final byte AREF_SWITCHVALUE
See Also:
Constant Field Values

ASET_SWITCHVALUE

public static final byte ASET_SWITCHVALUE
See Also:
Constant Field Values

NIL_P_SWITCHVALUE

public static final byte NIL_P_SWITCHVALUE
See Also:
Constant Field Values

EQUALEQUAL_SWITCHVALUE

public static final byte EQUALEQUAL_SWITCHVALUE
See Also:
Constant Field Values

OP_GE_SWITCHVALUE

public static final byte OP_GE_SWITCHVALUE
See Also:
Constant Field Values

OP_LSHIFT_SWITCHVALUE

public static final byte OP_LSHIFT_SWITCHVALUE
See Also:
Constant Field Values

EMPTY_P_SWITCHVALUE

public static final byte EMPTY_P_SWITCHVALUE
See Also:
Constant Field Values

TO_S_SWITCHVALUE

public static final byte TO_S_SWITCHVALUE
See Also:
Constant Field Values

TO_I_SWITCHVALUE

public static final byte TO_I_SWITCHVALUE
See Also:
Constant Field Values

TO_STR_SWITCHVALUE

public static final byte TO_STR_SWITCHVALUE
See Also:
Constant Field Values

TO_SYM_SWITCHVALUE

public static final byte TO_SYM_SWITCHVALUE
See Also:
Constant Field Values

HASH_SWITCHVALUE

public static final byte HASH_SWITCHVALUE
See Also:
Constant Field Values

OP_GT_SWITCHVALUE

public static final byte OP_GT_SWITCHVALUE
See Also:
Constant Field Values

OP_TIMES_SWITCHVALUE

public static final byte OP_TIMES_SWITCHVALUE
See Also:
Constant Field Values

OP_LE_SWITCHVALUE

public static final byte OP_LE_SWITCHVALUE
See Also:
Constant Field Values

OP_SPACESHIP_SWITCHVALUE

public static final byte OP_SPACESHIP_SWITCHVALUE
See Also:
Constant Field Values

LENGTH_SWITCHVALUE

public static final byte LENGTH_SWITCHVALUE
See Also:
Constant Field Values

MATCH_SWITCHVALUE

public static final byte MATCH_SWITCHVALUE
See Also:
Constant Field Values

EQQ_SWITCHVALUE

public static final byte EQQ_SWITCHVALUE
See Also:
Constant Field Values

INSPECT_SWITCHVALUE

public static final byte INSPECT_SWITCHVALUE
See Also:
Constant Field Values
Method Detail

createStringClass

public static RubyClass createStringClass(Ruby runtime)

callMethod

public IRubyObject callMethod(ThreadContext context,
                              RubyModule rubyclass,
                              int methodIndex,
                              java.lang.String name,
                              IRubyObject[] args,
                              CallType callType,
                              Block block)
Specified by:
callMethod in interface IRubyObject
Overrides:
callMethod in class RubyObject
Returns:

eql

public final boolean eql(IRubyObject other)
short circuit for String key comparison

Specified by:
eql in interface IRubyObject
Overrides:
eql in class RubyObject

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.

Specified by:
getNativeTypeIndex in interface IRubyObject
Overrides:
getNativeTypeIndex in class RubyObject
Returns:
the ClassIndex of the native type this object was constructed from

getJavaClass

public java.lang.Class getJavaClass()
Description copied from interface: IRubyObject
RubyMethod getJavaClass.

Specified by:
getJavaClass in interface IRubyObject
Overrides:
getJavaClass in class RubyObject
Returns:
Class

convertToString

public RubyString convertToString()
Specified by:
convertToString in interface IRubyObject
Overrides:
convertToString in class RubyObject
Returns:

toString

public java.lang.String toString()
Overrides:
toString in class RubyObject

strDup

public final RubyString strDup()
rb_str_dup


makeShared

public final RubyString makeShared(int index,
                                   int len)

modify

public final void modify()
rb_str_modify


modify

public final void modify(int length)

bytesToString

public static java.lang.String bytesToString(byte[] bytes,
                                             int beg,
                                             int len)

byteListToString

public static java.lang.String byteListToString(ByteList bytes)

bytesToString

public static java.lang.String bytesToString(byte[] bytes)

stringToBytes

public static byte[] stringToBytes(java.lang.String string)

isDigit

public static boolean isDigit(int c)

isUpper

public static boolean isUpper(int c)

isLower

public static boolean isLower(int c)

isLetter

public static boolean isLetter(int c)

isAlnum

public static boolean isAlnum(int c)

isPrint

public static boolean isPrint(int c)

checkStringType

public IRubyObject checkStringType()
Description copied from class: RubyObject
rb_check_string_type

Specified by:
checkStringType in interface IRubyObject
Overrides:
checkStringType in class RubyObject
Returns:

to_s

public IRubyObject to_s()
Overrides:
to_s in class RubyObject

op_cmp

public IRubyObject op_cmp(IRubyObject other)

equal

public IRubyObject equal(IRubyObject other)
Description copied from class: RubyObject
rb_equal

Specified by:
equal in interface IRubyObject
Overrides:
equal in class RubyObject

op_plus

public IRubyObject op_plus(IRubyObject other)

op_mul

public IRubyObject op_mul(IRubyObject other)

format

public IRubyObject format(IRubyObject arg)

hash

public RubyFixnum hash()
Overrides:
hash in class RubyObject

hashCode

public int hashCode()
Overrides:
hashCode in class RubyObject

equals

public boolean equals(java.lang.Object other)
Description copied from class: RubyObject
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.

Overrides:
equals in class RubyObject

objAsString

public static RubyString objAsString(IRubyObject obj)
rb_obj_as_string


cmp

public int cmp(RubyString other)
rb_str_cmp


asSymbol

public java.lang.String asSymbol()
rb_to_id

Specified by:
asSymbol in interface IRubyObject
Overrides:
asSymbol in class RubyObject
Returns:
String the symbol name

newString

public RubyString newString(java.lang.CharSequence s)
Create a new String which uses the same Ruby runtime and the same class like this String. This method should be used to satisfy RCR #38.


newString

public RubyString newString(ByteList s)
Create a new String which uses the same Ruby runtime and the same class like this String. This method should be used to satisfy RCR #38.


newString

public static RubyString newString(Ruby runtime,
                                   java.lang.CharSequence str)
rb_str_new2


newUnicodeString

public static RubyString newUnicodeString(Ruby runtime,
                                          java.lang.String str)

newString

public static RubyString newString(Ruby runtime,
                                   RubyClass clazz,
                                   java.lang.CharSequence str)

newString

public static RubyString newString(Ruby runtime,
                                   byte[] bytes)

newString

public static RubyString newString(Ruby runtime,
                                   ByteList bytes)

newStringShared

public static RubyString newStringShared(Ruby runtime,
                                         RubyString orig)

newStringShared

public static RubyString newStringShared(Ruby runtime,
                                         ByteList bytes)

newString

public static RubyString newString(Ruby runtime,
                                   byte[] bytes,
                                   int start,
                                   int length)

doClone

public IRubyObject doClone()
Overrides:
doClone in class RubyObject

cat

public RubyString cat(byte[] str)

cat

public RubyString cat(byte[] str,
                      int beg,
                      int len)

cat

public RubyString cat(ByteList str)

cat

public RubyString cat(byte ch)

replace

public RubyString replace(IRubyObject other)
rb_str_replace_m


reverse

public RubyString reverse()

reverse_bang

public RubyString reverse_bang()

newInstance

public static RubyString newInstance(IRubyObject recv,
                                     IRubyObject[] args,
                                     Block block)
rb_str_s_new


initialize

public IRubyObject initialize(IRubyObject[] args,
                              Block unusedBlock)
Overrides:
initialize in class RubyObject

casecmp

public IRubyObject casecmp(IRubyObject other)

match

public IRubyObject match(IRubyObject other)
rb_str_match

Overrides:
match in class RubyObject

match2

public IRubyObject match2()
rb_str_match2


match3

public IRubyObject match3(IRubyObject pattern)
String#match(pattern)

Parameters:
pattern - Regexp or String

capitalize

public IRubyObject capitalize()
rb_str_capitalize


capitalize_bang

public IRubyObject capitalize_bang()
rb_str_capitalize_bang


op_ge

public IRubyObject op_ge(IRubyObject other)

op_gt

public IRubyObject op_gt(IRubyObject other)

op_le

public IRubyObject op_le(IRubyObject other)

op_lt

public IRubyObject op_lt(IRubyObject other)

eql_p

public IRubyObject eql_p(IRubyObject other)

upcase

public RubyString upcase()
rb_str_upcase


upcase_bang

public IRubyObject upcase_bang()
rb_str_upcase_bang


downcase

public RubyString downcase()
rb_str_downcase


downcase_bang

public IRubyObject downcase_bang()
rb_str_downcase_bang


swapcase

public RubyString swapcase()
rb_str_swapcase


swapcase_bang

public IRubyObject swapcase_bang()
rb_str_swapcase_bang


dump

public IRubyObject dump()
rb_str_dump


insert

public IRubyObject insert(IRubyObject indexArg,
                          IRubyObject stringArg)

inspect

public IRubyObject inspect()
rb_str_inspect

Specified by:
inspect in interface IRubyObject
Overrides:
inspect in class RubyObject
Returns:
String

length

public RubyFixnum length()
rb_str_length


empty

public RubyBoolean empty()
rb_str_empty


append

public RubyString append(IRubyObject other)
rb_str_append


concat

public RubyString concat(IRubyObject other)
rb_str_concat


crypt

public RubyString crypt(IRubyObject other)
rb_str_crypt


stringValue

public static RubyString stringValue(IRubyObject object)

sub

public IRubyObject sub(IRubyObject[] args,
                       Block block)
rb_str_sub


sub_bang

public IRubyObject sub_bang(IRubyObject[] args,
                            Block block)
rb_str_sub_bang


gsub

public IRubyObject gsub(IRubyObject[] args,
                        Block block)
rb_str_gsub


gsub_bang

public IRubyObject gsub_bang(IRubyObject[] args,
                             Block block)
rb_str_gsub_bang


index

public IRubyObject index(IRubyObject[] args)
rb_str_index_m


rindex

public IRubyObject rindex(IRubyObject[] args)
rb_str_rindex_m


substr

public IRubyObject substr(int beg,
                          int len)

replace

public IRubyObject replace(int beg,
                           int len,
                           RubyString replaceWith)

aref

public IRubyObject aref(IRubyObject[] args)
rb_str_aref, rb_str_aref_m


aset

public IRubyObject aset(IRubyObject[] args)
rb_str_aset, rb_str_aset_m


slice_bang

public IRubyObject slice_bang(IRubyObject[] args)
rb_str_slice_bang


succ

public IRubyObject succ()

succ_bang

public IRubyObject succ_bang()

upto

public IRubyObject upto(IRubyObject str,
                        Block block)
rb_str_upto_m


upto

public IRubyObject upto(IRubyObject str,
                        boolean excl,
                        Block block)

include

public RubyBoolean include(IRubyObject obj)
rb_str_include


to_i

public IRubyObject to_i(IRubyObject[] args)
rb_str_to_i


oct

public IRubyObject oct()
rb_str_oct


hex

public IRubyObject hex()
rb_str_hex


to_f

public IRubyObject to_f()
rb_str_to_f


split

public RubyArray split(IRubyObject[] args)
rb_str_split_m


scan

public IRubyObject scan(IRubyObject arg,
                        Block block)
rb_str_scan


ljust

public IRubyObject ljust(IRubyObject[] args)
rb_str_ljust


rjust

public IRubyObject rjust(IRubyObject[] args)
rb_str_rjust


center

public IRubyObject center(IRubyObject[] args)

chop

public IRubyObject chop()

chop_bang

public IRubyObject chop_bang()
rb_str_chop_bang


chomp

public RubyString chomp(IRubyObject[] args)
rb_str_chop


chomp_bang

public IRubyObject chomp_bang(IRubyObject[] args)
rb_str_chomp_bang In the common case, removes CR and LF characters in various ways depending on the value of the optional args[0]. If args.length==0 removes one instance of CR, CRLF or LF from the end of the string. If args.length>0 and args[0] is "\n" then same behaviour as args.length==0 . If args.length>0 and args[0] is "" then removes trailing multiple LF or CRLF (but no CRs at all(!)).

Parameters:
args - See method description.

lstrip

public IRubyObject lstrip()
rb_str_lstrip


lstrip_bang

public IRubyObject lstrip_bang()
rb_str_lstrip_bang


rstrip

public IRubyObject rstrip()
rb_str_rstrip


rstrip_bang

public IRubyObject rstrip_bang()
rb_str_rstrip_bang


strip

public IRubyObject strip()
rb_str_strip


strip_bang

public IRubyObject strip_bang()
rb_str_strip_bang


count

public IRubyObject count(IRubyObject[] args)
rb_str_count


delete

public IRubyObject delete(IRubyObject[] args)
rb_str_delete


delete_bang

public IRubyObject delete_bang(IRubyObject[] args)
rb_str_delete_bang


squeeze

public IRubyObject squeeze(IRubyObject[] args)
rb_str_squeeze


squeeze_bang

public IRubyObject squeeze_bang(IRubyObject[] args)
rb_str_squeeze_bang


tr

public IRubyObject tr(IRubyObject src,
                      IRubyObject repl)
rb_str_tr


tr_bang

public IRubyObject tr_bang(IRubyObject src,
                           IRubyObject repl)
rb_str_tr_bang


tr_s

public IRubyObject tr_s(IRubyObject src,
                        IRubyObject repl)
rb_str_tr_s


tr_s_bang

public IRubyObject tr_s_bang(IRubyObject src,
                             IRubyObject repl)
rb_str_tr_s_bang


each_line

public IRubyObject each_line(IRubyObject[] args,
                             Block block)
rb_str_each_line


each_byte

public RubyString each_byte(Block block)
rb_str_each_byte


intern

public RubySymbol intern()
rb_str_intern


to_sym

public RubySymbol to_sym()

sum

public RubyInteger sum(IRubyObject[] args)

unmarshalFrom

public static RubyString unmarshalFrom(UnmarshalStream input)
                                throws java.io.IOException
Throws:
java.io.IOException

unpack

public RubyArray unpack(IRubyObject obj)
See Also:
Pack.unpack(org.jruby.Ruby, org.jruby.util.ByteList, org.jruby.util.ByteList)

setValue

public void setValue(java.lang.CharSequence value)
Mutator for internal string representation.

Parameters:
value - The new java.lang.String this RubyString should encapsulate

setValue

public void setValue(ByteList value)

getValue

public java.lang.CharSequence getValue()

getUnicodeValue

public java.lang.String getUnicodeValue()

toUTF

public static byte[] toUTF(java.lang.String string)

setUnicodeValue

public void setUnicodeValue(java.lang.String newValue)

getBytes

public byte[] getBytes()

getByteList

public ByteList getByteList()


Copyright © 2002-2007 JRuby Team. All Rights Reserved.