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.Data
Nested 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_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, 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, varTableStamp
Fields 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 IRubyObject
at
(int nth) Deprecated.final IRubyObject
at
(ThreadContext context, int nth) static int
backrefNumber
(Ruby runtime, org.joni.Regex pattern, org.joni.Region regs, IRubyObject obj) Deprecated.final int
backrefNumber
(Ruby runtime, IRubyObject obj) Deprecated.static int
backrefNumber
(ThreadContext context, org.joni.Regex pattern, org.joni.Region regs, IRubyObject obj) final int
backrefNumber
(ThreadContext context, IRubyObject obj) int
begin
(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_capturesvoid
Lots of MRI objects keep their state in non-lookupable ivars (e:g.static RubyClass
createMatchDataClass
(ThreadContext context, RubyClass Object) deconstruct
(ThreadContext context) deconstruct_keys
(ThreadContext context, IRubyObject what) int
end
(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) boolean
This override does not do a "checked" dispatch.getNamedBackrefValues
(Ruby runtime) Deprecated.int
getNameToBackrefNumber
(String name) Deprecated.int
getNameToBackrefNumber
(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.int
hashCode()
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) int
numRegs()
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 void
use()
final boolean
used()
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, toString
Methods 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, yieldUnder
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.jruby.runtime.builtin.IRubyObject
checkStringType19, dup, marshalLiveVariables
-
Constructor Details
-
RubyMatchData
-
RubyMatchData
-
-
Method Details
-
createMatchDataClass
-
copySpecialInstanceVariables
Description copied from class:RubyBasicObject
Lots 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:
copySpecialInstanceVariables
in interfaceIRubyObject
- Overrides:
copySpecialInstanceVariables
in classRubyBasicObject
-
getNativeClassIndex
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:
getNativeClassIndex
in interfaceCoreObjectType
- Overrides:
getNativeClassIndex
in 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:IRubyObject
RubyMethod inspect.- Specified by:
inspect
in interfaceIRubyObject
- Overrides:
inspect
in classRubyBasicObject
- Returns:
- String
-
inspect
Description copied from class:RubyBasicObject
Returns a string containing a human-readable representation of obj. If not overridden, uses theto_s
method 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:
inspect
in interfaceIRubyObject
- Overrides:
inspect
in classRubyBasicObject
-
regexp
-
names
-
to_a
match_to_a- Overrides:
to_a
in 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_s
in classRubyBasicObject
-
string
Deprecated. -
string
match_string -
initialize_copy
Description copied from class:RubyBasicObject
Initializes 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_copy
in classRubyBasicObject
- Parameters:
context
- the thread contextoriginal
- the original- Returns:
- a copy unless the same thing
-
equals
Description copied from class:RubyObject
This override does not do a "checked" dispatch.- Overrides:
equals
in classRubyObject
- Parameters:
other
- object to compare- Returns:
- true if equals
- See Also:
-
eql_p
- Overrides:
eql_p
in classRubyBasicObject
-
hashCode
public int hashCode()Description copied from class:RubyObject
This override does not do "checked" dispatch since Object usually has #hash defined.- Overrides:
hashCode
in classRubyObject
- Returns:
- the hash code
- See Also:
-
hash
Description copied from class:RubyBasicObject
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 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_a
in classRubyBasicObject
-
op_aref
Deprecated. -
op_aref
Deprecated.
-