| Class | Line # | Actions | |||
|---|---|---|---|---|---|
| NullPattern | 16 | 4 | 4 |
| 1 | // | |
| 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 | |
| 5 | // the details. | |
| 6 | // -- Happy Computing! | |
| 7 | // | |
| 8 | package com.stevesoft.pat; | |
| 9 | ||
| 10 | import java.util.Hashtable; | |
| 11 | ||
| 12 | /** | |
| 13 | * This pattern matches nothing -- it is found in patterns like (hello|world|) | |
| 14 | * where a zero-length subelement occurs. | |
| 15 | */ | |
| 16 | class NullPattern extends Pattern | |
| 17 | { | |
| 18 | 0 | public String toString() |
| 19 | { | |
| 20 | 0 | return nextString(); |
| 21 | } | |
| 22 | ||
| 23 | 0 | public int matchInternal(int p, Pthings pt) |
| 24 | { | |
| 25 | 0 | return nextMatch(p, pt); |
| 26 | } | |
| 27 | ||
| 28 | 0 | public patInt maxChars() |
| 29 | { | |
| 30 | 0 | return new patInt(0); |
| 31 | } | |
| 32 | ||
| 33 | 0 | Pattern clone1(Hashtable h) |
| 34 | { | |
| 35 | 0 | return new NullPattern(); |
| 36 | } | |
| 37 | } |