JAL-1807 Bob's JalviewJS prototype first commit
[jalviewjs.git] / unused / com / stevesoft / pat / NullPattern.java
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.*;
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   public String toString()
19   {
20     return nextString();
21   }
22
23   public int matchInternal(int p, Pthings pt)
24   {
25     return nextMatch(p, pt);
26   }
27
28   public patInt maxChars()
29   {
30     return new patInt(0);
31   }
32
33   Pattern clone1(Hashtable h)
34   {
35     return new NullPattern();
36   }
37 }