Clover icon

Coverage Report

  1. Project Clover database Wed Nov 13 2024 18:27:33 GMT
  2. Package com.stevesoft.pat

File Custom.java

 

Coverage histogram

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

Code metrics

2
13
6
1
64
39
7
0.54
2.17
6
1.17

Classes

Class Line # Actions
Custom 20 13 7
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    * Simple custom patterns. See
14    * <a href="http://javaregex.com/code/deriv2.java.html">deriv2.java</a> and
15    * <a href="http://javaregex.com/code/deriv3.java.html">deriv3.java</a> in the
16    * test directory.
17    *
18    * @see com.stevesoft.pat.CustomEndpoint
19    */
 
20    class Custom extends PatternSub
21    {
22    String select;
23   
24    Validator v;
25   
26    int start;
27   
 
28  0 toggle Custom(String s)
29    {
30  0 select = s;
31  0 v = (Validator) Regex.validators.get(s);
32    }
33   
 
34  0 toggle public int matchInternal(int pos, Pthings pt)
35    {
36  0 start = pos;
37  0 return sub.matchInternal(pos, pt);
38    }
39   
 
40  0 toggle public String toString()
41    {
42  0 String a = v.argsave == null ? "" : ":" + v.argsave;
43  0 return "(??" + select + a + ")" + nextString();
44    }
45   
 
46  0 toggle public patInt minChars()
47    {
48  0 return v.minChars();
49    }
50   
 
51  0 toggle public patInt maxChars()
52    {
53  0 return v.maxChars();
54    }
55   
 
56  0 toggle Pattern clone1(Hashtable h)
57    {
58  0 Custom c = new Custom(select);
59  0 h.put(c, c);
60  0 h.put(this, c);
61  0 c.sub = sub.clone(h);
62  0 return c;
63    }
64    }