Clover icon

Coverage Report

  1. Project Clover database Wed Nov 13 2024 16:12:26 GMT
  2. Package com.stevesoft.pat

File NullPattern.java

 

Coverage histogram

../../../img/srcFileCovDistChart8.png
21% of files have more coverage

Code metrics

0
4
4
1
37
21
4
1
1
4
1

Classes

Class Line # Actions
NullPattern 16 4 4
0.7575%
 

Contributing tests

This file is covered by 31 tests. .

Source view

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 toggle public String toString()
19    {
20  0 return nextString();
21    }
22   
 
23  11 toggle public int matchInternal(int p, Pthings pt)
24    {
25  11 return nextMatch(p, pt);
26    }
27   
 
28  363 toggle public patInt maxChars()
29    {
30  363 return new patInt(0);
31    }
32   
 
33  196 toggle Pattern clone1(Hashtable h)
34    {
35  196 return new NullPattern();
36    }
37    }