Build 1.0_r1(from source)

java.util.regex
Class MatchResultImpl

java.lang.Object
  extended by java.util.regex.MatchResultImpl
All Implemented Interfaces:
MatchResult

 class MatchResultImpl
extends Object
implements MatchResult

Holds the results of a successful match of a regular expression against a given string. Only used internally, thus sparsely documented (though the defining public interface has full documentation).

See Also:
MatchResult

Constructor Summary
MatchResultImpl(String text, int[] offsets)
           
 
Method Summary
 int end()
          Returns the index of the first character following the text that matched the whole regular expression.
 int end(int group)
          Returns the index of the first character following the text that matched a given group.
 String group()
          Returns the text that matched the whole regular expression.
 String group(int group)
          Returns the text that matched a given group of the regular expression.
 int groupCount()
          Returns the number of groups in the result, which is always equal to the number of groups in the original regular expression.
 int start()
          Returns the index of the first character of the text that matched the whole regular expression.
 int start(int group)
          Returns the index of the first character of the text that matched a given group.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MatchResultImpl

MatchResultImpl(String text,
                int[] offsets)
Method Detail

end

public int end()
Description copied from interface: MatchResult
Returns the index of the first character following the text that matched the whole regular expression.

Specified by:
end in interface MatchResult
Returns:
the character index.

end

public int end(int group)
Description copied from interface: MatchResult
Returns the index of the first character following the text that matched a given group.

Specified by:
end in interface MatchResult
Parameters:
group - the group, ranging from 0 to groupCount() - 1, with 0 representing the whole pattern.
Returns:
the character index.

group

public String group()
Description copied from interface: MatchResult
Returns the text that matched the whole regular expression.

Specified by:
group in interface MatchResult
Returns:
the text.

group

public String group(int group)
Description copied from interface: MatchResult
Returns the text that matched a given group of the regular expression.

Specified by:
group in interface MatchResult
Parameters:
group - the group, ranging from 0 to groupCount() - 1, with 0 representing the whole pattern.
Returns:
the text that matched the group.

groupCount

public int groupCount()
Description copied from interface: MatchResult
Returns the number of groups in the result, which is always equal to the number of groups in the original regular expression.

Specified by:
groupCount in interface MatchResult
Returns:
the number of groups.

start

public int start()
Description copied from interface: MatchResult
Returns the index of the first character of the text that matched the whole regular expression.

Specified by:
start in interface MatchResult
Returns:
the character index.

start

public int start(int group)
Description copied from interface: MatchResult
Returns the index of the first character of the text that matched a given group.

Specified by:
start in interface MatchResult
Parameters:
group - the group, ranging from 0 to groupCount() - 1, with 0 representing the whole pattern.
Returns:
the character index.

Build 1.0_r1(from source)

Please submit a feedback, bug or feature