Clover icon

Coverage Report

  1. Project Clover database Thu Nov 7 2024 17:01:39 GMT
  2. Package com.stevesoft.pat

File Start.java

 

Coverage histogram

../../../img/srcFileCovDistChart0.png
0% of files have more coverage

Code metrics

6
11
5
1
56
41
11
1
2.2
5
2.2

Classes

Class Line # Actions
Start 13 11 11
0.00%
 

Contributing tests

No tests hitting this source file were found.

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