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.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, 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.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(ThreadContext context)
           
 void clearEncodingNone()
           
 void clearKCodeDefault()
           
 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)
           
 Encoding getEncoding()
           
 KCode getKCode()
           
 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 options)
           
static RubyRegexp newInstance(IRubyObject recv, IRubyObject[] args)
           
static RubyRegexp newRegexp(Ruby runtime, ByteList pattern)
           
static RubyRegexp newRegexp(Ruby runtime, ByteList pattern, int options)
           
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(ThreadContext context, IRubyObject other)
          rb_obj_equal Will by default use identity equality to compare objects.
 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, IRubyObject obj)
           
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 setEncodingNone()
           
 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 try_convert(ThreadContext context, IRubyObject recv, IRubyObject args)
           
static IRubyObject union(ThreadContext context, IRubyObject recv, IRubyObject[] args)
          rb_reg_s_union
static RubyRegexp unmarshalFrom(UnmarshalStream input)
           
 
Methods inherited from class org.jruby.RubyObject
as, attachToObjectSpace, callInit, checkFrozen, convertToType, createObjectClass, display, dup, eql_p, eqlInternal, equal_p, equalInternal, equals, evalUnder, evalUnder, extend, freeze, frozen_p, hashCode, id_deprecated, id, initialize, instance_eval, instance_eval, instance_eval, instance_eval, instance_eval, instance_exec, instance_of_p, instance_variable_defined_p, instance_variable_get, instance_variable_set, instance_variables, kind_of_p, method, methods, nil_p, op_eqq, private_methods, protected_methods, public_methods, puts, rbClone, remove_instance_variable, respond_to_p, respond_to_p, send, send, send, send, send, singleton_methods, singleton_methods19, singletonMethods, specificEval, specificEval, specificEval, specificEval, specificEval, taint, tainted_p, to_a, to_java, toString, trust, type_deprecated, type, untaint, untrust, untrusted_p, validateInstanceVariable
 
Methods inherited from class org.jruby.RubyBasicObject
addFinalizer, anyToString, asJavaString, asString, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callSuper, checkArrayType, checkStringType, compareTo, convertToArray, convertToFloat, convertToHash, convertToInteger, convertToInteger, convertToInteger, convertToString, copyInstanceVariablesInto, copySpecialInstanceVariables, createBasicObjectClass, dataGetStruct, dataWrapStruct, ensureInstanceVariablesSettable, eql, fastGetInstanceVariable, fastGetInternalVariable, fastHasInstanceVariable, fastHasInternalVariable, fastSetInstanceVariable, fastSetInternalVariable, getFlag, getInstanceVariable, getInstanceVariableList, getInstanceVariableNameList, getInstanceVariables, getInternalVariable, getInternalVariables, getJavaClass, getMetaClass, getRuntime, getSingletonClass, getSingletonClassClone, getType, getVariable, getVariableCount, getVariableList, getVariableNameList, hasInstanceVariable, hasInternalVariable, hasVariables, infectBy, isClass, isFalse, isFrozen, isImmediate, isModule, isNil, isTaint, isTrue, isUntrusted, makeMetaClass, op_not_equal, op_not, removeFinalizers, removeInstanceVariable, removeInternalVariable, respondsTo, setFlag, setFrozen, setInstanceVariable, setInternalVariable, setMetaClass, setTaint, setUntrusted, setVariable, syncVariables, taint, testFrozen, testFrozen, variableTableContains, variableTableFastContains, variableTableFastFetch, variableTableFastStore, variableTableFetch, variableTableGetSize, 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()

setEncodingNone

public void setEncodingNone()

clearEncodingNone

public void clearEncodingNone()

isEncodingNone

public boolean isEncodingNone()

getKCode

public KCode getKCode()

getEncoding

public Encoding getEncoding()
Specified by:
getEncoding 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,
                                   int options)

newRegexp

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

newDRegexp

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

newRegexp

public static RubyRegexp newRegexp(Ruby runtime,
                                   ByteList pattern)

preprocessCheck

public static void preprocessCheck(Ruby runtime,
                                   IRubyObject obj)

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


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 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: 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 maintenance.

Overrides:
hash in class RubyObject

op_equal

public IRubyObject op_equal(ThreadContext context,
                            IRubyObject other)
Description copied from class: RubyObject
rb_obj_equal Will by default use identity equality to compare objects. This follows the Ruby semantics.

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

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 RubyObject

op_match19

public IRubyObject op_match19(ThreadContext context,
                              IRubyObject arg)

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 RubyObject
Returns:
String

inspect19

public IRubyObject inspect19()

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

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