Oracle Fusion Middleware Java API Reference for Oracle ADF Mobile Client
11g Release 1 (11.1.1)

E17503-02

oracle.adfnmc.java.util.regex
Class Matcher

java.lang.Object
  extended by oracle.adfnmc.java.util.regex.Matcher
All Implemented Interfaces:
MatchResult

public final class Matcher
extends java.lang.Object
implements MatchResult

Note: main functionality of this class is hidden into nodes match methods.


Method Summary
 Matcher appendReplacement(java.lang.StringBuffer sb, java.lang.String replacement)
           
 java.lang.StringBuffer appendTail(java.lang.StringBuffer sb)
          TODO: appendTail(StringBuffer) javadoc
 int end()
           
 int end(int groupIndex)
           
 boolean find()
          The find() method matches the pattern against the character sequence beginning at the character after the last match or at the beginning of the sequence if called immediately after reset().
 boolean find(int startIndex)
           
 java.lang.String group()
           
 java.lang.String group(int groupIndex)
           
 int groupCount()
          Return the number of capturing groups in the pattern.
 boolean hasAnchoringBounds()
           
 boolean hasTransparentBounds()
           
 boolean hitEnd()
           
 boolean lookingAt()
          This method attempts to match the pattern against the character sequence starting at the beginning.
 boolean matches()
          This method is identical in function to the Pattern.matches() method.
 Pattern pattern()
          Return a reference to the pattern used by this Matcher.
static java.lang.String quoteReplacement(java.lang.String string)
           
 Matcher region(int leftBound, int rightBound)
           
 int regionEnd()
           
 int regionStart()
           
 java.lang.String replaceAll(java.lang.String replacement)
          Replace all occurrences of character sequences which match the pattern with the given replacement string.
 java.lang.String replaceFirst(java.lang.String replacement)
          This is very similar to replaceAll except only the first occurrence of a sequence matching the pattern is replaced.
 boolean requireEnd()
           
 Matcher reset()
           
 Matcher reset(java.lang.String newSequence)
           
 int start()
           
 int start(int groupIndex)
           
 MatchResult toMatchResult()
           
 Matcher useAnchoringBounds(boolean value)
           
 Matcher usePattern(Pattern pat)
           
 Matcher useTransparentBounds(boolean value)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

appendReplacement

public Matcher appendReplacement(java.lang.StringBuffer sb,
                                 java.lang.String replacement)

reset

public Matcher reset(java.lang.String newSequence)

reset

public Matcher reset()

region

public Matcher region(int leftBound,
                      int rightBound)

appendTail

public java.lang.StringBuffer appendTail(java.lang.StringBuffer sb)
TODO: appendTail(StringBuffer) javadoc

Parameters:
sb -
Returns:

replaceFirst

public java.lang.String replaceFirst(java.lang.String replacement)
This is very similar to replaceAll except only the first occurrence of a sequence matching the pattern is replaced.

Parameters:
replacement - A string to replace occurrences of character sequences matching the pattern.
Returns:
A new string with replacements inserted

replaceAll

public java.lang.String replaceAll(java.lang.String replacement)
Replace all occurrences of character sequences which match the pattern with the given replacement string. The replacement string may refer to capturing groups using the syntax "$".

Parameters:
replacement - A string to replace occurrences of character sequences matching the pattern.
Returns:
A new string with replacements inserted

pattern

public Pattern pattern()
Return a reference to the pattern used by this Matcher.

Returns:
A reference to the pattern used by this Matcher.

group

public java.lang.String group(int groupIndex)
Specified by:
group in interface MatchResult

group

public java.lang.String group()
Specified by:
group in interface MatchResult

find

public boolean find(int startIndex)

find

public boolean find()
The find() method matches the pattern against the character sequence beginning at the character after the last match or at the beginning of the sequence if called immediately after reset(). The method returns true if and only if a match is found.

Returns:
A boolean indicating if the pattern was matched.

start

public int start(int groupIndex)
Specified by:
start in interface MatchResult

end

public int end(int groupIndex)
Specified by:
end in interface MatchResult

matches

public boolean matches()
This method is identical in function to the Pattern.matches() method. It returns true if and only if the regular expression pattern matches the entire input character sequence.

Returns:
A boolean indicating if the pattern matches the entire input character sequence.

quoteReplacement

public static java.lang.String quoteReplacement(java.lang.String string)

lookingAt

public boolean lookingAt()
This method attempts to match the pattern against the character sequence starting at the beginning. If the pattern matches even a prefix of the input character sequence, lookingAt() will return true. Otherwise it will return false.

Returns:
A boolean indicating if the pattern matches a prefix of the input character sequence.

start

public int start()
Specified by:
start in interface MatchResult

groupCount

public int groupCount()
Return the number of capturing groups in the pattern.

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

end

public int end()
Specified by:
end in interface MatchResult

toMatchResult

public MatchResult toMatchResult()

useAnchoringBounds

public Matcher useAnchoringBounds(boolean value)

hasAnchoringBounds

public boolean hasAnchoringBounds()

useTransparentBounds

public Matcher useTransparentBounds(boolean value)

hasTransparentBounds

public boolean hasTransparentBounds()

regionStart

public int regionStart()

regionEnd

public int regionEnd()

requireEnd

public boolean requireEnd()

hitEnd

public boolean hitEnd()

usePattern

public Matcher usePattern(Pattern pat)

Oracle Fusion Middleware Java API Reference for Oracle ADF Mobile Client
11g Release 1 (11.1.1)

E17503-02

Copyright © 2011, Oracle and/or its affiliates. All rights reserved.