Clover icon

Coverage Report

  1. Project Clover database Thu Aug 13 2020 12:04:21 BST
  2. Package com.stevesoft.pat

File Any.java

 

Coverage histogram

../../../img/srcFileCovDistChart4.png
44% of files have more coverage

Code metrics

6
10
5
1
55
39
8
0.8
2
5
1.6

Classes

Class Line # Actions
Any 15 10 8
0.380952438.1%
 

Contributing tests

This file is covered by 1 test. .

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 is the '.' character in a Pattern. It matches any character.
14    */
 
15    class Any extends Pattern
16    {
 
17  13 toggle public int matchInternal(int pos, Pthings pt)
18    {
19  13 if (pos < pt.src.length())
20    {
21  13 if (pt.dotDoesntMatchCR)
22    {
23  13 if (pt.src.charAt(pos) != '\n')
24    {
25  13 return nextMatch(pos + 1, pt);
26    }
27    }
28    else
29    {
30  0 return nextMatch(pos + 1, pt);
31    }
32    }
33  0 return -1;
34    }
35   
 
36  0 toggle public String toString()
37    {
38  0 return "." + nextString();
39    }
40   
 
41  0 toggle public patInt minChars()
42    {
43  0 return new patInt(1);
44    }
45   
 
46  0 toggle public patInt maxChars()
47    {
48  0 return new patInt(1);
49    }
50   
 
51  0 toggle public Pattern clone1(Hashtable h)
52    {
53  0 return new Any();
54    }
55    };