org.jruby
Class RubyRegexp

java.lang.Object
  extended by org.jruby.RubyObject
      extended by org.jruby.RubyRegexp
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, ReOptions, InstanceVariables, InternalVariables, IRubyObject, CoreObjectType

public class RubyRegexp
extends RubyObject
implements ReOptions

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class org.jruby.RubyObject
RubyObject.Finalizer, RubyObject.ObjectMethods, RubyObject.VariableTableEntry
 
Field Summary
 
Fields inherited from class org.jruby.RubyObject
ALL_F, ERR_INSECURE_SET_INST_VAR, FALSE_F, FL_USHIFT, flags, FROZEN_F, metaClass, metaClassName, NEVER, NIL_F, OBJECT_ALLOCATOR, TAINTED_F, UNDEF, USER0_F, USER1_F, USER2_F, USER3_F, USER4_F, USER5_F, USER6_F, USER7_F, VARIABLE_TABLE_DEFAULT_CAPACITY, VARIABLE_TABLE_EMPTY_TABLE, VARIABLE_TABLE_LOAD_FACTOR, VARIABLE_TABLE_MAXIMUM_CAPACITY, variableTable, variableTableSize, variableTableThreshold
 
Fields inherited from interface org.jruby.parser.ReOptions
RE_MAY_IGNORECASE, RE_OPTION_EXTENDED, RE_OPTION_IGNORECASE, RE_OPTION_LONGEST, RE_OPTION_MULTILINE, RE_OPTION_ONCE, RE_OPTION_POSIXLINE, RE_OPTION_SINGLELINE, RE_UNICODE
 
Fields inherited from interface org.jruby.runtime.builtin.IRubyObject
NULL_ARRAY
 
Method Summary
 IRubyObject casefold_p()
           
 void clearKCodeDefault()
           
 void clearLiteral()
           
static RubyClass createRegexpClass(Ruby runtime)
           
 IRubyObject eqq(ThreadContext context, IRubyObject str)
          rb_reg_eqq
 KCode getKCode()
           
 int getNativeTypeIndex()
          This is overridden in the other concrete Java builtins to provide a fast way to determine what type they are.
 Regex getPattern()
           
 RubyFixnum hash()
          rb_obj_id Will return the hash code of this object.
 IRubyObject initialize_copy(IRubyObject re)
          rb_reg_init_copy
 IRubyObject initialize_m(IRubyObject[] args)
          rb_reg_initialize_m
 IRubyObject inspect()
          rb_reg_inspect
 boolean isKCodeDefault()
           
 boolean isLiteral()
           
 IRubyObject kcode()
           
static IRubyObject last_match_s(ThreadContext context, IRubyObject recv, IRubyObject[] args)
          rb_reg_s_last_match
static IRubyObject last_match(IRubyObject match)
          rb_reg_last_match
static void marshalTo(RubyRegexp regexp, MarshalStream output)
           
static IRubyObject match_last(IRubyObject match)
          rb_reg_match_last
 IRubyObject match_m(ThreadContext context, IRubyObject str)
          rb_reg_match_m
static IRubyObject match_post(IRubyObject match)
          rb_reg_match_post
static IRubyObject match_pre(IRubyObject match)
          rb_reg_match_pre
static RubyRegexp newInstance(IRubyObject recv, IRubyObject[] args)
           
static RubyRegexp newRegexp(Ruby runtime, ByteList pattern, int options, boolean quote)
           
static RubyRegexp newRegexp(Ruby runtime, java.lang.String pattern, int options)
           
static IRubyObject nth_match(int nth, IRubyObject match)
          rb_reg_nth_match
 IRubyObject op_equal(IRubyObject other)
           
 IRubyObject op_match(ThreadContext context, IRubyObject str)
          rb_reg_match
 IRubyObject op_match2(ThreadContext context)
           
 IRubyObject options()
           
static ByteList quote(ByteList str, KCode kcode)
          rb_reg_quote
static RubyString quote(IRubyObject recv, IRubyObject[] args)
          rb_reg_s_quote
 RubyString regsub(RubyString str, RubyString src, Matcher matcher)
           
 int search(ThreadContext context, RubyString str, int pos, boolean reverse)
          rb_reg_search
 void setKCodeDefault()
           
 void setLiteral()
           
 IRubyObject source()
          rb_reg_source
 IRubyObject to_s()
          rb_any_to_s call-seq: obj.to_s => string Returns a string representing obj.
static IRubyObject union(ThreadContext context, IRubyObject recv, IRubyObject[] args)
          rb_reg_s_union
static RubyRegexp unmarshalFrom(UnmarshalStream input)
           
 void warn(java.lang.String message)
           
 
Methods inherited from class org.jruby.RubyObject
addFinalizer, anyToString, asJavaString, asString, attachToObjectSpace, callInit, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callSuper, checkArrayType, checkFrozen, checkStringType, convertToArray, convertToFloat, convertToHash, convertToInteger, convertToInteger, convertToString, convertToType, copySpecialInstanceVariables, createObjectClass, dataGetStruct, dataWrapStruct, display, dup, ensureInstanceVariablesSettable, eql_p, eql, eqlInternal, equal_p, equalInternal, equals, evalUnder, extend, fastGetInstanceVariable, fastGetInternalVariable, fastHasInstanceVariable, fastHasInternalVariable, fastSetInstanceVariable, fastSetInternalVariable, freeze, frozen_p, getFlag, getInstanceVariable, getInstanceVariableList, getInstanceVariableNameList, getInstanceVariables, getInternalVariable, getInternalVariableList, getInternalVariables, getJavaClass, getMetaClass, getRuntime, getSingletonClass, getSingletonClassClone, getType, getVariableCount, getVariableList, getVariableMap, getVariableNameList, hashCode, hasInstanceVariable, hasInternalVariable, hasVariables, id_deprecated, id, infectBy, initialize, instance_eval, instance_exec, instance_of_p, instance_variable_defined_p, instance_variable_get, instance_variable_set, instance_variables, isClass, isFalse, isFrozen, isImmediate, isModule, isNil, isRubyVariable, isTaint, isTrue, kind_of_p, makeMetaClass, method, methods, nil_p, op_eqq, op_equal, private_methods, protected_methods, public_methods, puts, rbClone, remove_instance_variable, removeFinalizers, removeInstanceVariable, removeInternalVariable, respond_to_p, respond_to_p, respondsTo, send, setFlag, setFrozen, setInstanceVariable, setInternalVariable, setMetaClass, setTaint, singleton_methods, specificEval, syncVariables, taint, tainted_p, testFrozen, to_a, toString, type_deprecated, type, untaint, validateInstanceVariable, variableTableContains, variableTableFastContains, variableTableFastFetch, variableTableFastStore, variableTableFetch, variableTableGetMap, variableTableGetMap, variableTableGetSize, variableTableGetTable, variableTableReadLocked, variableTableRehash, variableTableRemove, variableTableStore, variableTableSync
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

setLiteral

public void setLiteral()

clearLiteral

public void clearLiteral()

isLiteral

public boolean isLiteral()

setKCodeDefault

public void setKCodeDefault()

clearKCodeDefault

public void clearKCodeDefault()

isKCodeDefault

public boolean isKCodeDefault()

getKCode

public KCode getKCode()

createRegexpClass

public static RubyClass createRegexpClass(Ruby runtime)

newRegexp

public static RubyRegexp newRegexp(Ruby runtime,
                                   java.lang.String pattern,
                                   int options)

newRegexp

public static RubyRegexp newRegexp(Ruby runtime,
                                   ByteList pattern,
                                   int options,
                                   boolean quote)

warn

public void warn(java.lang.String message)

kcode

public IRubyObject kcode()

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. Will generally return a value from org.jruby.runtime.ClassIndex

Specified by:
getNativeTypeIndex in interface CoreObjectType
Overrides:
getNativeTypeIndex in class RubyObject
Returns:
the ClassIndex of the native type this object was constructed from
See Also:
org.jruby.runtime.ClassInde

getPattern

public Regex getPattern()

hash

public RubyFixnum hash()
Description copied from class: RubyObject
rb_obj_id 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 maintainence.

Overrides:
hash in class RubyObject

op_equal

public IRubyObject op_equal(IRubyObject other)

op_match2

public IRubyObject op_match2(ThreadContext context)

eqq

public IRubyObject eqq(ThreadContext context,
                       IRubyObject str)
rb_reg_eqq


initialize_copy

public IRubyObject initialize_copy(IRubyObject re)
rb_reg_init_copy

Overrides:
initialize_copy in class RubyObject

initialize_m

public IRubyObject initialize_m(IRubyObject[] args)
rb_reg_initialize_m


newInstance

public static RubyRegexp newInstance(IRubyObject recv,
                                     IRubyObject[] args)

options

public IRubyObject options()

search

public int search(ThreadContext context,
                  RubyString str,
                  int pos,
                  boolean reverse)
rb_reg_search


op_match

public IRubyObject op_match(ThreadContext context,
                            IRubyObject str)
rb_reg_match

Overrides:
op_match in class RubyObject

match_m

public IRubyObject match_m(ThreadContext context,
                           IRubyObject str)
rb_reg_match_m


regsub

public RubyString regsub(RubyString str,
                         RubyString src,
                         Matcher matcher)

casefold_p

public IRubyObject casefold_p()

source

public IRubyObject source()
rb_reg_source


inspect

public IRubyObject inspect()
rb_reg_inspect

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

to_s

public IRubyObject to_s()
Description copied from class: RubyObject
rb_any_to_s call-seq: obj.to_s => string Returns a string representing obj. The default 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.''

Overrides:
to_s in class RubyObject

quote

public static RubyString quote(IRubyObject recv,
                               IRubyObject[] args)
rb_reg_s_quote


quote

public static ByteList quote(ByteList str,
                             KCode kcode)
rb_reg_quote


nth_match

public static IRubyObject nth_match(int nth,
                                    IRubyObject match)
rb_reg_nth_match


last_match

public static IRubyObject last_match(IRubyObject match)
rb_reg_last_match


last_match_s

public static IRubyObject last_match_s(ThreadContext context,
                                       IRubyObject recv,
                                       IRubyObject[] args)
rb_reg_s_last_match


match_pre

public static IRubyObject match_pre(IRubyObject match)
rb_reg_match_pre


match_post

public static IRubyObject match_post(IRubyObject match)
rb_reg_match_post


match_last

public static IRubyObject match_last(IRubyObject match)
rb_reg_match_last


union

public static IRubyObject union(ThreadContext context,
                                IRubyObject recv,
                                IRubyObject[] args)
rb_reg_s_union


unmarshalFrom

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

marshalTo

public static void marshalTo(RubyRegexp regexp,
                             MarshalStream output)
                      throws java.io.IOException
Throws:
java.io.IOException


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