Package org.jruby
Class RubyMatchData
java.lang.Object
org.jruby.RubyBasicObject
org.jruby.RubyObject
org.jruby.RubyMatchData
- All Implemented Interfaces:
Serializable,Cloneable,Comparable<IRubyObject>,InstanceVariables,InternalVariables,IRubyObject,CoreObjectType
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.jruby.RubyObject
RubyObject.DataNested classes/interfaces inherited from class org.jruby.RubyBasicObject
RubyBasicObject.Finalizer -
Field Summary
Fields inherited from class org.jruby.RubyObject
IVAR_INSPECTING_OBJECT_ALLOCATOR, OBJECT_ALLOCATOR, REIFYING_OBJECT_ALLOCATORFields 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, IS_OVERLAID_F, metaClass, NEVER, NIL_F, REFINED_MODULE_F, STAMP_OFFSET, TAINTED_F, UNDEF, USER0_F, USER1_F, USER2_F, USER3_F, USER4_F, USER5_F, USER6_F, USER7_F, USER8_F, USER9_F, USERA_F, VAR_TABLE_OFFSET, varTable, varTableStampFields inherited from interface org.jruby.runtime.builtin.IRubyObject
NULL_ARRAY -
Constructor Summary
ConstructorsConstructorDescriptionRubyMatchData(Ruby runtime) RubyMatchData(Ruby runtime, RubyClass metaClass) -
Method Summary
Modifier and TypeMethodDescriptionfinal IRubyObjectat(int nth) Deprecated.final IRubyObjectat(ThreadContext context, int nth) static intbackrefNumber(Ruby runtime, org.joni.Regex pattern, org.joni.Region regs, IRubyObject obj) Deprecated.final intbackrefNumber(Ruby runtime, IRubyObject obj) Deprecated.static intbackrefNumber(ThreadContext context, org.joni.Regex pattern, org.joni.Region regs, IRubyObject obj) final intbackrefNumber(ThreadContext context, IRubyObject obj) intbegin(int i) Get the begin offset of the given region, or -1 if the region does not exist.begin(ThreadContext context, IRubyObject index) MRI: match_beginbytebegin(ThreadContext context, IRubyObject group) byteend(ThreadContext context, IRubyObject group) byteoffset(ThreadContext context, IRubyObject group) captures(ThreadContext context) match_capturesvoidLots of MRI objects keep their state in non-lookupable ivars (e:g.static RubyClasscreateMatchDataClass(ThreadContext context, RubyClass Object) deconstruct(ThreadContext context) deconstruct_keys(ThreadContext context, IRubyObject what) intend(int i) Get the end offset of the given region, or -1 if the region does not exist.end(ThreadContext context, IRubyObject index) match_endeql_p(ThreadContext context, IRubyObject obj) booleanThis override does not do a "checked" dispatch.getNamedBackrefValues(Ruby runtime) Deprecated.intgetNameToBackrefNumber(String name) Deprecated.intgetNameToBackrefNumber(ThreadContext context, String name) This is overridden in the other concrete Java builtins to provide a fast way to determine what type they are.group(int n) Deprecated.group(long n) Deprecated.group(ThreadContext context, int n) hash(ThreadContext context) Will return the hash code of this object.inthashCode()This override does not do "checked" dispatch since Object usually has #hash defined.initialize_copy(ThreadContext context, IRubyObject original) Initializes this object as a copy of the original, that is the parameter to this object.inspect()Deprecated.inspect(ThreadContext context) Returns a string containing a human-readable representation of obj.match(ThreadContext context, IRubyObject nth) match_length(ThreadContext context, IRubyObject nth) named_captures(ThreadContext context) Deprecated.named_captures(ThreadContext context, IRubyObject[] args) names(ThreadContext context, Block block) intnumRegs()Fetch the number of regions in this match.offset(ThreadContext context, IRubyObject index) match_offsetoffset19(ThreadContext context, IRubyObject index) Deprecated.op_aref(IRubyObject idx) Deprecated.op_aref(IRubyObject idx, IRubyObject rest) Deprecated.op_aref(ThreadContext context, IRubyObject idx) match_arefop_aref(ThreadContext context, IRubyObject idx, IRubyObject rest) match_arefpost_match(ThreadContext context) match_post_matchpre_match(ThreadContext context) match_pre_matchregexp(ThreadContext context, Block block) size(ThreadContext context) match_sizestring()Deprecated.string(ThreadContext context) match_stringto_a()Deprecated.to_a(ThreadContext context) match_to_ato_s(ThreadContext context) match_to_sfinal voiduse()final booleanused()values_at(IRubyObject[] args) Deprecated.values_at(ThreadContext context, IRubyObject[] args) Methods inherited from class org.jruby.RubyObject
attachToObjectSpace, callInit, callInit, callInit, callInit, callInit, callInit, callInit, callInit, callInit, callInit, convertToType, dig, dig1, dig2, eqlInternal, equalInternal, finishObjectClass, inspect, op_eqq, puts, specificEval, toRubyString, toStringMethods inherited from class org.jruby.RubyBasicObject
addFinalizer, addFinalizer, anyToString, asJavaString, asString, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callSuper, checkArrayType, checkCallMethod, checkCallMethod, checkFrozen, checkStringType, cloneSetup, compareTo, convertToArray, convertToFloat, convertToHash, convertToInteger, convertToInteger, convertToInteger, convertToString, copyInstanceVariablesInto, dataGetStruct, dataGetStructChecked, dataWrapStruct, decode, display, dup, dupFinalizer, dupSetup, ensureInstanceVariablesSettable, eql, eql_p, equal_p, evalUnder, extend, fastGetInstanceVariable, fastGetInternalVariable, fastHasInstanceVariable, fastHasInternalVariable, fastSetInstanceVariable, fastSetInternalVariable, finishBasicObjectClass, forEachInstanceVariable, forEachInstanceVariableName, freeze, frozen_p, getCurrentContext, getFFIHandle, getFlag, getInstanceEvalClass, getInstanceEvalClass, getInstanceVariable, getInstanceVariableList, getInstanceVariableNameList, getInstanceVariables, getInternalVariable, getInternalVariables, getJavaClass, getMarshalVariableList, getMetaClass, getMetaClass, getNativeHandle, getNativeTypeIndex, getObjectId, getRuntime, getSingletonClass, getSingletonClassClone, getSingletonClassCloneAndAttach, getSingletonClassCloneAndAttach, getType, getVariable, getVariableCount, getVariableList, getVariableNameList, hash, hashyInspect, hasInstanceVariable, hasInstanceVariables, hasInternalVariable, hasVariables, id, infectBy, initialize, initialize_copy, inspectHashCode, 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, isBuiltin, isClass, isFalse, isFrozen, isImmediate, isModule, isNil, isSpecialConst, isSpecialObject, isTaint, isTrue, isUntrusted, kind_of_p, makeMetaClass, makeMetaClass, makeMetaClassBootstrap, method, method, method, method_missing, methods, methods, nil_p, nonFixnumHashCode, nonFixnumHashCode, OBJ_INIT_COPY, objInitCopy, op_cmp, op_equal, op_match, op_not, op_not_equal, op_not_match, private_methods, protected_methods, public_methods, rbClone, rbClone, rbInspect, remove_instance_variable, removeFinalizers, removeInstanceVariable, removeInternalVariable, respond_to_p, respond_to_p, respondsTo, respondsToMissing, respondsToMissing, send, send, send, send, send, setFFIHandle, setFlag, setFrozen, setInstanceVariable, setInternalVariable, setMetaClass, setNativeHandle, setTaint, setUntrusted, setVariable, singleton_method, singleton_method, singleton_method_added, singleton_method_removed, singleton_method_undefined, singleton_methods, singletonClass, specificEval, specificEval, specificEval, specificEval, syncVariables, syncVariables, taint, taint, tainted_p, testFrozen, testFrozen, to_s, toJava, trust, type, untaint, untrust, untrusted_p, validateInstanceVariable, validateInstanceVariable, validateInstanceVariable, variableTableContains, variableTableFastContains, variableTableFastFetch, variableTableFastStore, variableTableFetch, variableTableRemove, variableTableStore, variableTableSync, yieldUnder, yieldUnderMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.jruby.runtime.builtin.IRubyObject
checkStringType19, dup, marshalLiveVariables
-
Constructor Details
-
RubyMatchData
-
RubyMatchData
-
-
Method Details
-
createMatchDataClass
-
copySpecialInstanceVariables
Description copied from class:RubyBasicObjectLots of MRI objects keep their state in non-lookupable ivars (e:g. Range, Struct, etc). This method is responsible for dupping our java field equivalents- Specified by:
copySpecialInstanceVariablesin interfaceIRubyObject- Overrides:
copySpecialInstanceVariablesin classRubyBasicObject
-
getNativeClassIndex
Description copied from class:RubyObjectThis 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:
getNativeClassIndexin interfaceCoreObjectType- Overrides:
getNativeClassIndexin classRubyObject- Returns:
- the ClassIndex of the native type this object was constructed from
- See Also:
-
use
public final void use() -
used
public final boolean used() -
group
Deprecated. -
group
Deprecated. -
group
-
getNameToBackrefNumber
Deprecated. -
getNameToBackrefNumber
-
getNamedBackrefValues
Deprecated. -
byteoffset
-
bytebegin
-
byteend
-
inspect
Deprecated.Description copied from interface:IRubyObjectRubyMethod inspect.- Specified by:
inspectin interfaceIRubyObject- Overrides:
inspectin classRubyBasicObject- Returns:
- String
-
inspect
Description copied from class:RubyBasicObjectReturns a string containing a human-readable representation of obj. If not overridden, uses theto_smethod to generate the string. [ 1, 2, 3..4, 'five' ].inspect #=> "[1, 2, 3..4, \"five\"]" Time.new.inspect #=> "Wed Apr 09 08:54:39 CDT 2003"- Specified by:
inspectin interfaceIRubyObject- Overrides:
inspectin classRubyBasicObject
-
regexp
-
names
-
to_a
match_to_a- Overrides:
to_ain classRubyBasicObject
-
values_at
-
values_at
Deprecated. -
captures
match_captures -
backrefNumber
Deprecated. -
backrefNumber
-
backrefNumber
@Deprecated(since="10.0") public static int backrefNumber(Ruby runtime, org.joni.Regex pattern, org.joni.Region regs, IRubyObject obj) Deprecated. -
backrefNumber
public static int backrefNumber(ThreadContext context, org.joni.Regex pattern, org.joni.Region regs, IRubyObject obj) -
op_aref
match_aref -
op_aref
match_aref -
at
Deprecated. -
at
-
size
match_size -
begin
MRI: match_begin -
end
match_end -
offset19
Deprecated. -
offset
match_offset -
pre_match
match_pre_match -
match
-
match_length
-
post_match
match_post_match -
to_s
match_to_s- Overrides:
to_sin classRubyBasicObject
-
string
Deprecated. -
string
match_string -
initialize_copy
Description copied from class:RubyBasicObjectInitializes this object as a copy of the original, that is the parameter to this object. Will make sure that the argument actually has the same real class as this object. It shouldn't be possible to initialize an object with something totally different.- Overrides:
initialize_copyin classRubyBasicObject- Parameters:
context- the thread contextoriginal- the original- Returns:
- a copy unless the same thing
-
equals
Description copied from class:RubyObjectThis override does not do a "checked" dispatch.- Overrides:
equalsin classRubyObject- Parameters:
other- object to compare- Returns:
- true if equals
- See Also:
-
eql_p
- Overrides:
eql_pin classRubyBasicObject
-
hashCode
public int hashCode()Description copied from class:RubyObjectThis override does not do "checked" dispatch since Object usually has #hash defined.- Overrides:
hashCodein classRubyObject- Returns:
- the hash code
- See Also:
-
hash
Description copied from class:RubyBasicObjectWill 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:
hashin classRubyBasicObject- Parameters:
context- the current thread context- Returns:
- the hash value
-
named_captures
Deprecated. -
named_captures
-
deconstruct
-
deconstruct_keys
-
begin
public int begin(int i) Get the begin offset of the given region, or -1 if the region does not exist.- Parameters:
i- the region for which to fetch the begin offset- Returns:
- the begin offset for the region
-
end
public int end(int i) Get the end offset of the given region, or -1 if the region does not exist.- Parameters:
i- the region for which to fetch the end offset- Returns:
- the end offset for the region
-
numRegs
public int numRegs()Fetch the number of regions in this match.- Returns:
- the number of regions in this match
-
to_a
Deprecated.- Overrides:
to_ain classRubyBasicObject
-
op_aref
Deprecated. -
op_aref
Deprecated.
-