org.jawk.jrt
Class PatternPair

java.lang.Object
  extended by org.jawk.jrt.PatternPair

public class PatternPair
extends java.lang.Object

A pair of regular expressions such that matching means previous text has matched the first regex, but not the second regex. When text matches the second regex, it is still considered a match. However, subsequent matching attempts are false unless the first regex is matched again.

If text matches both the first and second regex, the entry is considered a match, but subsequent entries are not considered matched (unless the text matches the first regex).


Constructor Summary
PatternPair(java.lang.String s1, java.lang.String s2)
           
 
Method Summary
 boolean matches(java.lang.String str)
          Text is matched against this regex pair, returning true only if this or previous text matches the first regex, up until the text is matched against the second regex.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PatternPair

public PatternPair(java.lang.String s1,
                   java.lang.String s2)
Method Detail

matches

public boolean matches(java.lang.String str)
Text is matched against this regex pair, returning true only if this or previous text matches the first regex, up until the text is matched against the second regex.

Parameters:
str - Text to match against the first and second regular expressions.
Returns:
true if this or previous text matches the first regex, up until text matches the second regex, which is still considered a match, but subsequent text is not considered a match (unless, of course, the text matches the first regex).

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object