| 77 | } |
| 78 | |
| 79 | private static class RealCharUtil implements CharUtilTest |
| 80 | { |
| 81 | public void newText ( String s ) |
| 82 | { |
| 83 | _triples.add( new Triple( s, 0, s.length() ) ); |
| 84 | } |
| 85 | |
| 86 | public int numTexts ( ) |
| 87 | { |
| 88 | return _triples.size(); |
| 89 | } |
| 90 | |
| 91 | public String getText ( int i ) |
| 92 | { |
| 93 | Triple t = (Triple) _triples.get( i ); |
| 94 | |
| 95 | return CharUtil.getString( t._src, t._off, t._cch ); |
| 96 | } |
| 97 | |
| 98 | public int length ( int i ) |
| 99 | { |
| 100 | return ((Triple) _triples.get( i ))._cch; |
| 101 | } |
| 102 | |
| 103 | public void insert ( int i, int j, int off ) |
| 104 | { |
| 105 | Triple ti = (Triple) _triples.get( i ); |
| 106 | Triple tj = (Triple) _triples.get( j ); |
| 107 | |
| 108 | Object src = |
| 109 | _cu.insertChars( off, ti._src, ti._off, ti._cch, tj._src, tj._off, tj._cch ); |
| 110 | |
| 111 | _triples.set( i, new Triple( src, _cu._offSrc, _cu._cchSrc ) ); |
| 112 | } |
| 113 | |
| 114 | public void remove ( int i, int off, int cch ) |
| 115 | { |
| 116 | Triple ti = (Triple) _triples.get( i ); |
| 117 | |
| 118 | Object src = _cu.removeChars( off, cch, ti._src, ti._off, ti._cch ); |
| 119 | |
| 120 | _triples.set( i, new Triple( src, _cu._offSrc, _cu._cchSrc ) ); |
| 121 | } |
| 122 | |
| 123 | ArrayList _triples = new ArrayList(); |
| 124 | CharUtil _cu = new CharUtil( 1024 ); |
| 125 | } |
| 126 | |
| 127 | private static class FakeCharUtil implements CharUtilTest |
| 128 | { |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…