Clover icon

Coverage Report

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

File Backup.java

 

Coverage histogram

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

Code metrics

4
8
6
1
54
34
8
1
1.33
6
1.33

Classes

Class Line # Actions
Backup 17 8 8
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    /**
13    * Implements the (?<number) Pattern, where number is an integer telling us
14    * how far to back up in the Pattern. Not in perl 5. It also allows
15    * (?>number).
16    */
 
17    class Backup extends Pattern
18    {
19    int bk;
20   
 
21  0 toggle Backup(int ii)
22    {
23  0 bk = ii;
24    }
25   
 
26  0 toggle public String toString()
27    {
28  0 return "(?" + (bk < 0 ? ">" + (-bk) : "<" + bk) + ")" + nextString();
29    }
30   
 
31  0 toggle public int matchInternal(int pos, Pthings pt)
32    {
33  0 if (pos < bk)
34    {
35  0 return -1;
36    }
37  0 return nextMatch(pos - bk, pt);
38    }
39   
 
40  0 toggle public patInt minChars()
41    {
42  0 return new patInt(-bk);
43    }
44   
 
45  0 toggle public patInt maxChars()
46    {
47  0 return new patInt(-bk);
48    }
49   
 
50  0 toggle public Pattern clone1(Hashtable h)
51    {
52  0 return new Backup(bk);
53    }
54    };