2 // This software is now distributed according to
3 // the Lesser Gnu Public License. Please see
4 // http://www.gnu.org/copyleft/lesser.txt for
8 package com.stevesoft.pat;
10 import java.util.Hashtable;
12 /** Implements "(?= )" and "(?! )" */
13 class lookAhead extends Or
22 public Pattern getNext()
27 public int nextMatch(int pos, Pthings pt)
29 Pattern p = super.getNext();
32 return p.matchInternal(pos, pt);
40 public int matchInternal(int pos, Pthings pt)
42 if (super.matchInternal(pos, pt) >= 0)
50 return nextMatch(pos, pt);
57 return nextMatch(pos, pt);
78 public patInt minChars()
83 public patInt maxChars()
88 Pattern clone1(Hashtable h)
90 lookAhead la = new lookAhead(reverse);
93 for (int i = 0; i < v.size(); i++)
95 la.v.addElement(((Pattern) v.elementAt(i)).clone(h));