org.jruby
Class RubyRegexp

java.lang.Object
  extended byorg.jruby.RubyObject
      extended byorg.jruby.RubyRegexp
All Implemented Interfaces:
java.lang.Cloneable, IRubyObject, ReOptions

public class RubyRegexp
extends RubyObject
implements ReOptions

Author:
amoore

Nested Class Summary
 
Nested classes inherited from class org.jruby.RubyObject
RubyObject.Finalizer
 
Field Summary
static byte EQQ_SWITCHVALUE
           
static byte EQUALEQUAL_SWITCHVALUE
           
static byte HASH_SWITCHVALUE
           
static byte MATCH_SWITCHVALUE
           
static byte NIL_P_SWITCHVALUE
           
static byte TO_S_SWITCHVALUE
           
 
Fields inherited from class org.jruby.RubyObject
instanceVariables, isTrue, metaClass, NEVER, OBJECT_ALLOCATOR
 
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
 
Constructor Summary
RubyRegexp(Ruby runtime, RubyClass klass)
           
 
Method Summary
 IRubyObject callMethod(ThreadContext context, RubyModule rubyclass, int methodIndex, java.lang.String name, IRubyObject[] args, CallType callType, Block block)
           
 RubyBoolean casefold()
          rb_reg_casefold_p
static RubyClass createRegexpClass(Ruby runtime)
           
 IRubyObject eqq(IRubyObject target)
          rb_reg_eqq
 IRubyObject equal(IRubyObject other)
          rb_reg_equal
static java.lang.String escapeSpecialChars(java.lang.String original)
           
 int getNativeTypeIndex()
          This is overridden in the other concrete Java builtins to provide a fast way to determine what type they are.
 Pattern getPattern()
           
 RubyFixnum hash()
           
 IRubyObject initialize_copy(IRubyObject original)
          rb_reg_init_copy
 void initialize(ByteList regex, int options)
           
 IRubyObject initialize(IRubyObject[] args)
           
 void initialize(java.lang.String regex, int options)
           
 IRubyObject inspect()
          rb_reg_inspect
 IRubyObject kcode()
           
static IRubyObject last_match_s(IRubyObject recv, IRubyObject[] 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(IRubyObject target)
          rb_reg_match_m
static IRubyObject match_post(IRubyObject match)
          rb_reg_match_post
static IRubyObject match_pre(IRubyObject match)
          rb_reg_match_pre
 IRubyObject match(IRubyObject target)
          rb_reg_match
 IRubyObject match(java.lang.String target, RubyString rtarget, int startPos)
           
 IRubyObject match2()
          rb_reg_match2
static RubyRegexp newInstance(IRubyObject recv, IRubyObject[] args)
           
static RubyRegexp newRegexp(Ruby runtime, ByteList str, int options, java.lang.String kcode)
           
static RubyRegexp newRegexp(Ruby runtime, ByteList source, Pattern pattern, int flags, java.lang.String lang)
           
static RubyRegexp newRegexp(RubyString str, int options, java.lang.String lang)
           
static RubyRegexp newRegexp(Ruby runtime, java.lang.String str, int options, java.lang.String kcode)
           
static RubyRegexp newRegexp(Ruby runtime, java.lang.String source, Pattern pattern, int flags, java.lang.String lang)
           
static IRubyObject nth_match(int n, IRubyObject match)
          rb_reg_nth_match
static RubyString quote(IRubyObject recv, IRubyObject[] args)
          rb_reg_s_quote
static RubyString quote(IRubyObject recv, RubyString str)
          Utility version of quote that doesn't use encoding
static RubyRegexp regexpValue(IRubyObject obj)
           
 RubyString regsub(IRubyObject str, RubyString src, RubyMatchData match)
          rb_reg_regsub
 int search(java.lang.String target, RubyString rtarget, int pos)
          rb_reg_search
 IRubyObject search2(java.lang.String str, RubyString rtarget)
           
 int searchAgain(java.lang.String target, RubyString rtarget, boolean utf)
           
 RubyString source()
          rb_reg_source
 IRubyObject to_s()
           
 java.lang.String toString()
           
static IRubyObject union(IRubyObject recv, IRubyObject[] args)
          rb_reg_s_union
static RubyRegexp unmarshalFrom(UnmarshalStream input)
           
 
Methods inherited from class org.jruby.RubyObject
addFinalizer, anyToString, asString, asSymbol, attachToObjectSpace, callInit, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethodMissingIfNecessary, callSuper, checkArrayType, checkFrozen, checkStringType, compilerCallMethod, compilerCallMethodWithIndex, convertToArray, convertToFloat, convertToHash, convertToInteger, convertToString, convertToType, convertToType, convertToType, convertToTypeWithCheck, createObjectClass, dataGetStruct, dataWrapStruct, display, doClone, dup, eql, eqlInternal, equalInternal, equals, evalSimple, evalUnder, evalWithBinding, extend, freeze, frozen, getInstanceVariable, getInstanceVariables, getInstanceVariablesSnapshot, getJavaClass, getMetaClass, getRuntime, getSingletonClass, getSingletonClassClone, getType, hashCode, id_deprecated, id, infectBy, inherited, initCopy, initialize, 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

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

TO_S_SWITCHVALUE

public static final byte TO_S_SWITCHVALUE
See Also:
Constant Field Values

HASH_SWITCHVALUE

public static final byte HASH_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
Constructor Detail

RubyRegexp

public RubyRegexp(Ruby runtime,
                  RubyClass klass)
Method Detail

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.

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

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

initialize

public void initialize(ByteList regex,
                       int options)

initialize

public void initialize(java.lang.String regex,
                       int options)

escapeSpecialChars

public static java.lang.String escapeSpecialChars(java.lang.String original)

regexpValue

public static RubyRegexp regexpValue(IRubyObject obj)

newRegexp

public static RubyRegexp newRegexp(RubyString str,
                                   int options,
                                   java.lang.String lang)

newRegexp

public static RubyRegexp newRegexp(Ruby runtime,
                                   java.lang.String source,
                                   Pattern pattern,
                                   int flags,
                                   java.lang.String lang)

newRegexp

public static RubyRegexp newRegexp(Ruby runtime,
                                   ByteList source,
                                   Pattern pattern,
                                   int flags,
                                   java.lang.String lang)

newRegexp

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

newRegexp

public static RubyRegexp newRegexp(Ruby runtime,
                                   ByteList str,
                                   int options,
                                   java.lang.String kcode)

newInstance

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

initialize

public IRubyObject initialize(IRubyObject[] args)

quote

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


quote

public static RubyString quote(IRubyObject recv,
                               RubyString str)
Utility version of quote that doesn't use encoding


last_match_s

public static IRubyObject last_match_s(IRubyObject recv,
                                       IRubyObject[] args)

equal

public IRubyObject equal(IRubyObject other)
rb_reg_equal

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

match2

public IRubyObject match2()
rb_reg_match2


eqq

public IRubyObject eqq(IRubyObject target)
rb_reg_eqq


match

public IRubyObject match(IRubyObject target)
rb_reg_match

Overrides:
match in class RubyObject

match_m

public IRubyObject match_m(IRubyObject target)
rb_reg_match_m


source

public RubyString source()
rb_reg_source


kcode

public IRubyObject kcode()

casefold

public RubyBoolean casefold()
rb_reg_casefold_p


nth_match

public static IRubyObject nth_match(int n,
                                    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


search

public int search(java.lang.String target,
                  RubyString rtarget,
                  int pos)
rb_reg_search


search2

public IRubyObject search2(java.lang.String str,
                           RubyString rtarget)

searchAgain

public int searchAgain(java.lang.String target,
                       RubyString rtarget,
                       boolean utf)

match

public IRubyObject match(java.lang.String target,
                         RubyString rtarget,
                         int startPos)

regsub

public RubyString regsub(IRubyObject str,
                         RubyString src,
                         RubyMatchData match)
rb_reg_regsub


initialize_copy

public IRubyObject initialize_copy(IRubyObject original)
rb_reg_init_copy

Overrides:
initialize_copy in class RubyObject

inspect

public IRubyObject inspect()
rb_reg_inspect

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

union

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


to_s

public IRubyObject to_s()
Overrides:
to_s in class RubyObject

toString

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

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

getPattern

public Pattern getPattern()

hash

public RubyFixnum hash()
Overrides:
hash in class RubyObject


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