|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
StringOutput | Line # 24 | 5 | 4 | 100% |
1.0
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||
(3) | |||
Result | |||
0.7777778
|
org.qedeq.base.io.StringOutputTest.testGetPosition
![]() |
1 PASS | |
0.7777778
|
org.qedeq.base.io.StringOutputTest.testPushPop
![]() |
1 PASS | |
0.7777778
|
org.qedeq.base.io.StringOutputTest.testComplete
![]() |
1 PASS | |
1 | /* This file is part of the project "Hilbert II" - http://www.qedeq.org | |
2 | * | |
3 | * Copyright 2000-2014, Michael Meyling <mime@qedeq.org>. | |
4 | * | |
5 | * "Hilbert II" is free software; you can redistribute | |
6 | * it and/or modify it under the terms of the GNU General Public | |
7 | * License as published by the Free Software Foundation; either | |
8 | * version 2 of the License, or (at your option) any later version. | |
9 | * | |
10 | * This program is distributed in the hope that it will be useful, | |
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
13 | * GNU General Public License for more details. | |
14 | */ | |
15 | ||
16 | package org.qedeq.base.io; | |
17 | ||
18 | ||
19 | /** | |
20 | * Wraps a text output stream. | |
21 | * | |
22 | * @author Michael Meyling | |
23 | */ | |
24 | public class StringOutput extends AbstractOutput { | |
25 | ||
26 | /** Our buffer. */ | |
27 | private final StringBuffer output; | |
28 | ||
29 | /** | |
30 | * Constructor. | |
31 | */ | |
32 | 3 |
![]() |
33 | 3 | super(); |
34 | 3 | output = new StringBuffer(); |
35 | } | |
36 | ||
37 | 261 |
![]() |
38 | 261 | output.append(text); |
39 | } | |
40 | ||
41 | 3 |
![]() |
42 | 3 | return output.toString(); |
43 | } | |
44 | ||
45 | 1 |
![]() |
46 | 1 | return output.length(); |
47 | } | |
48 | ||
49 | } |
|