Clover icon

Coverage Report

  1. Project Clover database Mon Nov 18 2024 09:38:20 GMT
  2. Package com.stevesoft.pat.wrap

File StringWrap.java

 

Coverage histogram

../../../../img/srcFileCovDistChart9.png
7% of files have more coverage

Code metrics

0
8
8
1
60
39
8
1
1
8
1

Classes

Class Line # Actions
StringWrap 17 8 8
0.87587.5%
 

Contributing tests

This file is covered by 55 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.wrap;
9   
10    import com.stevesoft.pat.BasicStringBufferLike;
11    import com.stevesoft.pat.StringLike;
12   
13    /**
14    * A basic wrapper for the String object. Regex does not search String directly
15    * any longer, it searches StringLike.
16    */
 
17    public class StringWrap implements StringLike
18    {
19    String s;
20   
 
21  9161 toggle public StringWrap(String s)
22    {
23  9161 this.s = s;
24    }
25   
 
26  91 toggle public String toString()
27    {
28  91 return s;
29    }
30   
 
31  898324 toggle public char charAt(int i)
32    {
33  898324 return s.charAt(i);
34    }
35   
 
36  738153 toggle public int length()
37    {
38  738153 return s.length();
39    }
40   
 
41  11974 toggle public String substring(int i1, int i2)
42    {
43  11974 return s.substring(i1, i2);
44    }
45   
 
46  17549 toggle public Object unwrap()
47    {
48  17549 return s;
49    }
50   
 
51  3 toggle public BasicStringBufferLike newStringBufferLike()
52    {
53  3 return new StringBufferWrap();
54    }
55   
 
56  0 toggle public int indexOf(char c)
57    {
58  0 return s.indexOf(c);
59    }
60    }