| java.lang.Object java.util.regex.AbstractSet
All known Subclasses: java.util.regex.EOISet, java.util.regex.UEOLSet, java.util.regex.MultiLineEOLSet, java.util.regex.UMultiLineEOLSet, java.util.regex.JointSet, java.util.regex.PreviousMatch, java.util.regex.SOLSet, java.util.regex.LeafSet, java.util.regex.QuantifierSet, java.util.regex.MultiLineSOLSet, java.util.regex.FSet, java.util.regex.WordBoundary, java.util.regex.EOLSet,
AbstractSet | abstract class AbstractSet (Code) | | Basic class for nodes, representing given regular expression.
Note: All the classes representing nodes has set prefix;
author: Nikolay A. Kuznetsov version: $Revision: 1.12.2.2 $ |
Method Summary | |
public int | find(int stringIndex, CharSequence testString, MatchResultImpl matchResult) Attempts to apply pattern starting from this set/stringIndex; returns
index this search was started from, if value is negative, this means that
this search didn't succeed, additional information could be obtained via
matchResult;
Note: this is default implementation for find method, it's based on
matches, subclasses do not have to override find method unless
more effective find method exists for a particular node type
(sequence, i.e. | public int | findBack(int stringIndex, int startSearch, CharSequence testString, MatchResultImpl matchResult) | public boolean | first(AbstractSet set) Returns true if the given node intersects with this one,
false otherwise. | abstract protected String | getName() Returns name for the particular node type. | public AbstractSet | getNext() Returns the next. | protected String | getQualifiedName() | public int | getType() | abstract public boolean | hasConsumed(MatchResultImpl matchResult) Returns true, if this node has consumed any characters during
positive match attempt, for example node representing character always
consumes one character if it matches. | abstract public int | matches(int stringIndex, CharSequence testString, MatchResultImpl matchResult) Checks if this node matches in given position and recursively call
next node matches on positive self match. | public JointSet | processBackRefReplacement() This method is used for replacement backreferenced
sets. | public void | processSecondPass() This method is used for traversing nodes after the
first stage of compilation. | public void | setNext(AbstractSet next) | protected void | setType(int type) | public String | toString() |
TYPE_DOTSET | final public static int TYPE_DOTSET(Code) | | |
TYPE_FSET | final public static int TYPE_FSET(Code) | | |
TYPE_LEAF | final public static int TYPE_LEAF(Code) | | |
TYPE_QUANT | final public static int TYPE_QUANT(Code) | | |
counter | static int counter(Code) | | Counter for debugging purposes, represent unique node index;
|
isSecondPassVisited | protected boolean isSecondPassVisited(Code) | | |
AbstractSet | public AbstractSet()(Code) | | |
find | public int find(int stringIndex, CharSequence testString, MatchResultImpl matchResult)(Code) | | Attempts to apply pattern starting from this set/stringIndex; returns
index this search was started from, if value is negative, this means that
this search didn't succeed, additional information could be obtained via
matchResult;
Note: this is default implementation for find method, it's based on
matches, subclasses do not have to override find method unless
more effective find method exists for a particular node type
(sequence, i.e. substring, for example). Same applies for find back
method.
Parameters: stringIndex - starting index Parameters: testString - string to search in Parameters: matchResult - result of the match last searched index |
findBack | public int findBack(int stringIndex, int startSearch, CharSequence testString, MatchResultImpl matchResult)(Code) | | Parameters: stringIndex - -an index, to finish search back (left limit) Parameters: startSearch - -an index to start search from (right limit) Parameters: testString - -test string; Parameters: matchResult - match result an index to start back search next time if this search fails(newleft bound); if this search fails the value is negative; |
first | public boolean first(AbstractSet set)(Code) | | Returns true if the given node intersects with this one,
false otherwise.
This method is being used for quantifiers construction,
lets consider the following regular expression (a|b)*ccc.
(a|b) does not intersects with "ccc" and thus can be quantified
greedily (w/o kickbacks), like *+ instead of *.
Parameters: set - - usually previous node true if the given node intersects with this one |
getName | abstract protected String getName()(Code) | | Returns name for the particular node type.
Used for debugging purposes.
|
getType | public int getType()(Code) | | |
hasConsumed | abstract public boolean hasConsumed(MatchResultImpl matchResult)(Code) | | Returns true, if this node has consumed any characters during
positive match attempt, for example node representing character always
consumes one character if it matches. If particular node matches
empty sting this method will return false;
Parameters: matchResult - |
matches | abstract public int matches(int stringIndex, CharSequence testString, MatchResultImpl matchResult)(Code) | | Checks if this node matches in given position and recursively call
next node matches on positive self match. Returns positive integer if
entire match succeed, negative otherwise
Parameters: stringIndex - - string index to start from; Parameters: testString - - input string Parameters: matchResult - - MatchResult to sore result into -1 if match fails or n > 0; |
processBackRefReplacement | public JointSet processBackRefReplacement()(Code) | | This method is used for replacement backreferenced
sets.
Parameters: prev - - node who references to this node null if current node need not to be replacedJointSet which is replacement of current node otherwise |
processSecondPass | public void processSecondPass()(Code) | | This method is used for traversing nodes after the
first stage of compilation.
|
setNext | public void setNext(AbstractSet next)(Code) | | Sets next abstract set
Parameters: next - The next to set. |
setType | protected void setType(int type)(Code) | | |
|
|