Clover icon

Coverage Report

  1. Project Clover database Mon Nov 11 2024 20:42:03 GMT
  2. Package com.stevesoft.pat.wrap

File StringBufferWrap.java

 

Coverage histogram

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

Code metrics

0
6
6
1
50
31
6
1
1
6
1

Classes

Class Line # Actions
StringBufferWrap 17 6 6
0.3333333433.3%
 

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.wrap;
9   
10    import com.stevesoft.pat.BasicStringBufferLike;
11    import com.stevesoft.pat.StringLike;
12   
13    /**
14    * This provides a wrapper for StringBuffer to capture the output of a
15    * replacement.
16    */
 
17    public class StringBufferWrap implements BasicStringBufferLike
18    {
19    StringBuffer sb = new StringBuffer();
20   
 
21  130 toggle public void append(char c)
22    {
23  130 sb.append(c);
24    }
25   
 
26  0 toggle public void append(String s)
27    {
28  0 sb.append(s);
29    }
30   
 
31  0 toggle public int length()
32    {
33  0 return sb.length();
34    }
35   
 
36  0 toggle public String toString()
37    {
38  0 return sb.toString();
39    }
40   
 
41  3 toggle public StringLike toStringLike()
42    {
43  3 return new StringWrap(sb.toString());
44    }
45   
 
46  0 toggle public Object unwrap()
47    {
48  0 return sb;
49    }
50    }