Save This Page
Home » openjdk-7 » java » util » regex » [javadoc | source]
java.util.regex
abstract class: AbstractSet [javadoc | source]
java.lang.Object
   java.util.regex.AbstractSet
Basic class for nodes, representing given regular expression. Note: All the classes representing nodes has set prefix;
Field Summary
public static final  int TYPE_LEAF     
public static final  int TYPE_FSET     
public static final  int TYPE_QUANT     
public static final  int TYPE_DOTSET     
protected  AbstractSet next    Next node to visit 
static  int counter    Counter for debugging purposes, represent unique node index; 
protected  boolean isSecondPassVisited     
protected  String index     
Constructor:
 public AbstractSet() 
 public AbstractSet(AbstractSet n) 
Method from java.util.regex.AbstractSet Summary:
find,   findBack,   first,   getName,   getNext,   getQualifiedName,   getType,   hasConsumed,   matches,   processBackRefReplacement,   processSecondPass,   setNext,   setType,   toString
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from java.util.regex.AbstractSet Detail:
 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. substring, for example). Same applies for find back method.
 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. 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 *.
 abstract protected String getName()
    Returns name for the particular node type. Used for debugging purposes.
 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. If particular node matches empty sting this method will return false;
 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. Returns positive integer if entire match succeed, negative otherwise
 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) 
    Sets next abstract set
 protected  void setType(int type) 
 public String toString()