org.jruby
Class RubyRegexp

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

public class RubyRegexp
extends RubyObject
implements ReOptions, EncodingCapable

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class org.jruby.RubyObject
RubyObject.Data
 
Nested classes/interfaces inherited from class org.jruby.RubyBasicObject
RubyBasicObject.Finalizer
 
Field Summary
static int ARG_ENCODING_FIXED
           
 
Fields inherited from class org.jruby.RubyObject
OBJECT_ALLOCATOR, REIFYING_OBJECT_ALLOCATOR
 
Fields inherited from class org.jruby.RubyBasicObject
ALL_F, BASICOBJECT_ALLOCATOR, 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, USER8_F
 
Fields inherited from interface org.jruby.parser.ReOptions
RE_DEFAULT, RE_FIXED, RE_LITERAL, 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(ThreadContext context)
           
 void clearEncodingNone()
           
 void clearLiteral()
           
static RubyClass createRegexpClass(Ruby runtime)
           
 IRubyObject encoding(ThreadContext context)
           
 IRubyObject eqq(ThreadContext context, IRubyObject arg)
          rb_reg_eqq
 IRubyObject eqq19(ThreadContext context, IRubyObject arg)
           
 IRubyObject fixed_encoding_p(ThreadContext context)
           
 org.jcodings.Encoding getEncoding()
           
 KCode getKCode()
           
 java.lang.String[] getNames()
           
 int getNativeTypeIndex()
          This is overridden in the other concrete Java builtins to provide a fast way to determine what type they are.
 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 arg)
           
 IRubyObject initialize_m(IRubyObject arg0, IRubyObject arg1)
           
 IRubyObject initialize_m(IRubyObject arg0, IRubyObject arg1, IRubyObject arg2)
           
 IRubyObject initialize_m19(IRubyObject arg)
           
 IRubyObject initialize_m19(IRubyObject arg0, IRubyObject arg1)
           
 IRubyObject initialize_m19(IRubyObject arg0, IRubyObject arg1, IRubyObject arg2)
           
 IRubyObject inspect()
          rb_reg_inspect
 IRubyObject inspect19()
           
 boolean isEncodingNone()
           
 boolean isKCodeDefault()
           
 boolean isLiteral()
           
 IRubyObject kcode(ThreadContext context)
           
static IRubyObject last_match_s(ThreadContext context, IRubyObject recv)
          rb_reg_s_last_match / match_getter
static IRubyObject last_match_s(ThreadContext context, IRubyObject recv, IRubyObject nth)
          rb_reg_s_last_match
static IRubyObject last_match_s(ThreadContext context, IRubyObject recv, IRubyObject[] args)
          Deprecated. Use the versions with zero, one, or two args.
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
 IRubyObject match_m19(ThreadContext context, IRubyObject str, Block block)
           
 IRubyObject match_m19(ThreadContext context, IRubyObject str, IRubyObject pos, Block block)
           
static IRubyObject match_post(IRubyObject match)
          rb_reg_match_post
static IRubyObject match_pre(IRubyObject match)
          rb_reg_match_pre
 IRubyObject named_captures(ThreadContext context)
          rb_reg_named_captures
 IRubyObject names(ThreadContext context)
          rb_reg_names
static RubyRegexp newDRegexp(Ruby runtime, RubyString pattern, int joniOptions)
           
static RubyRegexp newDRegexp(Ruby runtime, RubyString pattern, RegexpOptions options)
           
static RubyRegexp newInstance(IRubyObject recv, IRubyObject[] args)
           
static RubyRegexp newRegexp(Ruby runtime, org.jruby.util.ByteList pattern)
           
static RubyRegexp newRegexp(Ruby runtime, org.jruby.util.ByteList pattern, RegexpOptions options)
           
static RubyRegexp newRegexp(Ruby runtime, java.lang.String pattern, RegexpOptions options)
           
static IRubyObject nth_match(int nth, IRubyObject match)
          rb_reg_nth_match
 IRubyObject op_equal(ThreadContext context, IRubyObject other)
           
 IRubyObject op_match(ThreadContext context, IRubyObject str)
          rb_reg_match
 IRubyObject op_match19(ThreadContext context, IRubyObject arg)
           
 IRubyObject op_match2(ThreadContext context)
           
 IRubyObject options()
           
static void preprocessCheck(Ruby runtime, org.jruby.util.ByteList bytes)
           
static RubyString quote(ThreadContext context, IRubyObject recv, IRubyObject[] args)
          rb_reg_s_quote
static IRubyObject quote19(ThreadContext context, IRubyObject recv, IRubyObject arg)
           
 int search(ThreadContext context, RubyString str, int pos, boolean reverse)
          rb_reg_search
 int search19(ThreadContext context, RubyString str, int pos, boolean reverse)
           
 void setEncoding(org.jcodings.Encoding encoding)
           
 void setEncodingNone()
           
 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 try_convert(ThreadContext context, IRubyObject recv, IRubyObject args)
           
static IRubyObject union(ThreadContext context, IRubyObject recv, IRubyObject[] args)
          rb_reg_s_union
static IRubyObject union19(ThreadContext context, IRubyObject recv, IRubyObject[] args)
           
static RubyRegexp unmarshalFrom(UnmarshalStream input)
           
 
Methods inherited from class org.jruby.RubyObject
attachToObjectSpace, callInit, callInit, callInit, callInit, callInit, convertToType, createObjectClass, eqlInternal, equalInternal, equals, hashCode, initialize, op_eqq, puts, specificEval, toString
 
Methods inherited from class org.jruby.RubyBasicObject
addFinalizer, anyToString, asJavaString, 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, eql, equal_p, equal_p19, evalUnder, extend, fastGetInstanceVariable, fastGetInternalVariable, fastHasInstanceVariable, fastHasInternalVariable, fastSetInstanceVariable, fastSetInternalVariable, freeze, frozen_p, getFlag, getInstanceEvalClass, getInstanceVariable, getInstanceVariableList, getInstanceVariableNameList, getInstanceVariables, getInternalVariable, getInternalVariables, getJavaClass, getMetaClass, getObjectId, getRuntime, getSingletonClass, getSingletonClassClone, getType, getVariable, getVariableCount, getVariableList, getVariableNameList, hashyInspect, hasInstanceVariable, hasInternalVariable, hasVariables, id_deprecated, id, infectBy, initialize19, initialize19, initialize19, initialize19, initialize19, initObjectId, 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, isImmediate, isModule, isNil, isTaint, isTrue, isUntrusted, kind_of_p, makeMetaClass, method_missing19, method, method19, methods, methods, methods19, nil_p, op_cmp, op_equal_19, op_not_equal, op_not_match, op_not, private_methods, private_methods19, protected_methods, protected_methods19, public_methods, public_methods19, rbClone, 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, send19, setFlag, setFrozen, setInstanceVariable, setInternalVariable, setMetaClass, setTaint, setUntrusted, setVariable, singleton_method_added19, singleton_method_removed19, singleton_method_undefined19, singleton_methods, singleton_methods19, specificEval, specificEval, specificEval, specificEval, syncVariables, syncVariables, taint, taint, tainted_p, testFrozen, testFrozen, to_a, toJava, trust, type_deprecated, type, untaint, untrust, untrusted_p, validateInstanceVariable, variableTableContains, variableTableFastContains, variableTableFastFetch, variableTableFastStore, variableTableFetch, variableTableRemove, variableTableStore, variableTableSync, yieldUnder, yieldUnder
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

ARG_ENCODING_FIXED

public static final int ARG_ENCODING_FIXED
See Also:
Constant Field Values
Method Detail

setLiteral

public void setLiteral()

clearLiteral

public void clearLiteral()

isLiteral

public boolean isLiteral()

isKCodeDefault

public boolean isKCodeDefault()

setEncodingNone

public void setEncodingNone()

clearEncodingNone

public void clearEncodingNone()

isEncodingNone

public boolean isEncodingNone()

getKCode

public KCode getKCode()

getEncoding

public org.jcodings.Encoding getEncoding()
Specified by:
getEncoding in interface EncodingCapable

setEncoding

public void setEncoding(org.jcodings.Encoding encoding)
Specified by:
setEncoding in interface EncodingCapable

createRegexpClass

public static RubyClass createRegexpClass(Ruby runtime)

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

newRegexp

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

newRegexp

public static RubyRegexp newRegexp(Ruby runtime,
                                   org.jruby.util.ByteList pattern,
                                   RegexpOptions options)

newDRegexp

public static RubyRegexp newDRegexp(Ruby runtime,
                                    RubyString pattern,
                                    RegexpOptions options)

newDRegexp

public static RubyRegexp newDRegexp(Ruby runtime,
                                    RubyString pattern,
                                    int joniOptions)

newRegexp

public static RubyRegexp newRegexp(Ruby runtime,
                                   org.jruby.util.ByteList pattern)

preprocessCheck

public static void preprocessCheck(Ruby runtime,
                                   org.jruby.util.ByteList bytes)

newInstance

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

try_convert

public static IRubyObject try_convert(ThreadContext context,
                                      IRubyObject recv,
                                      IRubyObject args)

quote

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


quote19

public static IRubyObject quote19(ThreadContext context,
                                  IRubyObject recv,
                                  IRubyObject arg)

last_match_s

public static IRubyObject last_match_s(ThreadContext context,
                                       IRubyObject recv,
                                       IRubyObject[] args)
Deprecated. Use the versions with zero, one, or two args.

Variable arity version for compatibility. Not bound to a Ruby method.


last_match_s

public static IRubyObject last_match_s(ThreadContext context,
                                       IRubyObject recv)
rb_reg_s_last_match / match_getter


last_match_s

public static IRubyObject last_match_s(ThreadContext context,
                                       IRubyObject recv,
                                       IRubyObject nth)
rb_reg_s_last_match


union

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


union19

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

initialize_copy

public IRubyObject initialize_copy(IRubyObject re)
rb_reg_init_copy

Overrides:
initialize_copy in class RubyBasicObject

initialize_m

public IRubyObject initialize_m(IRubyObject arg)

initialize_m

public IRubyObject initialize_m(IRubyObject arg0,
                                IRubyObject arg1)

initialize_m

public IRubyObject initialize_m(IRubyObject arg0,
                                IRubyObject arg1,
                                IRubyObject arg2)

initialize_m19

public IRubyObject initialize_m19(IRubyObject arg)

initialize_m19

public IRubyObject initialize_m19(IRubyObject arg0,
                                  IRubyObject arg1)

initialize_m19

public IRubyObject initialize_m19(IRubyObject arg0,
                                  IRubyObject arg1,
                                  IRubyObject arg2)

kcode

public IRubyObject kcode(ThreadContext context)

hash

public RubyFixnum hash()
Description copied from class: RubyBasicObject
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 maintenance.

Overrides:
hash in class RubyBasicObject

op_equal

public IRubyObject op_equal(ThreadContext context,
                            IRubyObject other)
Specified by:
op_equal in interface IRubyObject
Overrides:
op_equal in class RubyBasicObject

op_match2

public IRubyObject op_match2(ThreadContext context)

eqq

public IRubyObject eqq(ThreadContext context,
                       IRubyObject arg)
rb_reg_eqq


eqq19

public IRubyObject eqq19(ThreadContext context,
                         IRubyObject arg)

op_match

public IRubyObject op_match(ThreadContext context,
                            IRubyObject str)
rb_reg_match

Overrides:
op_match in class RubyBasicObject

op_match19

public IRubyObject op_match19(ThreadContext context,
                              IRubyObject arg)
Overrides:
op_match19 in class RubyBasicObject

match_m

public IRubyObject match_m(ThreadContext context,
                           IRubyObject str)
rb_reg_match_m


match_m19

public IRubyObject match_m19(ThreadContext context,
                             IRubyObject str,
                             Block block)

match_m19

public IRubyObject match_m19(ThreadContext context,
                             IRubyObject str,
                             IRubyObject pos,
                             Block block)

search

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


search19

public final int search19(ThreadContext context,
                          RubyString str,
                          int pos,
                          boolean reverse)

options

public IRubyObject options()

casefold_p

public IRubyObject casefold_p(ThreadContext context)

source

public IRubyObject source()
rb_reg_source


inspect

public IRubyObject inspect()
rb_reg_inspect

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

inspect19

public IRubyObject inspect19()

to_s

public IRubyObject to_s()
Description copied from class: RubyBasicObject
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 RubyBasicObject

getNames

public java.lang.String[] getNames()

names

public IRubyObject names(ThreadContext context)
rb_reg_names


named_captures

public IRubyObject named_captures(ThreadContext context)
rb_reg_named_captures


encoding

public IRubyObject encoding(ThreadContext context)

fixed_encoding_p

public IRubyObject fixed_encoding_p(ThreadContext context)

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


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


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-2009 JRuby Team. All Rights Reserved.