Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
ChatString |
|
| 1.0;1 |
1 | /* | |
2 | * $Id: ChatString.java 7963 2007-08-21 08:53:15Z dirk.olmes $ | |
3 | * -------------------------------------------------------------------------------------- | |
4 | * Copyright (c) MuleSource, Inc. All rights reserved. http://www.mulesource.com | |
5 | * | |
6 | * The software in this package is published under the terms of the CPAL v1.0 | |
7 | * license, a copy of which has been included with this distribution in the | |
8 | * LICENSE.txt file. | |
9 | */ | |
10 | ||
11 | package org.mule.samples.hello; | |
12 | ||
13 | import java.io.Serializable; | |
14 | ||
15 | /** | |
16 | * <code>ChatString</code> TODO (document class) | |
17 | */ | |
18 | 4 | public class ChatString implements Serializable |
19 | { | |
20 | /** | |
21 | * Serial version | |
22 | */ | |
23 | private static final long serialVersionUID = -3140370545357738491L; | |
24 | ||
25 | 4 | private StringBuffer string = new StringBuffer(); |
26 | ||
27 | /** | |
28 | * @param str | |
29 | * @return | |
30 | */ | |
31 | public StringBuffer append(String str) | |
32 | { | |
33 | 8 | return string.append(str); |
34 | } | |
35 | ||
36 | /** | |
37 | * @param sb | |
38 | * @return | |
39 | */ | |
40 | public StringBuffer append(StringBuffer sb) | |
41 | { | |
42 | 2 | return string.append(sb); |
43 | } | |
44 | ||
45 | /** | |
46 | * @param offset | |
47 | * @param str | |
48 | * @return | |
49 | */ | |
50 | public StringBuffer insert(int offset, char[] str) | |
51 | { | |
52 | 2 | return string.insert(offset, str); |
53 | } | |
54 | ||
55 | /** | |
56 | * @param index | |
57 | * @param str | |
58 | * @param offset | |
59 | * @param len | |
60 | * @return | |
61 | */ | |
62 | public StringBuffer insert(int index, char[] str, int offset, int len) | |
63 | { | |
64 | 2 | return string.insert(index, str, offset, len); |
65 | } | |
66 | ||
67 | /* | |
68 | * (non-Javadoc) | |
69 | * | |
70 | * @see java.lang.Object#toString() | |
71 | */ | |
72 | public String toString() | |
73 | { | |
74 | 4 | return string.toString(); |
75 | } | |
76 | ||
77 | public int getSize() | |
78 | { | |
79 | 10 | return string.length(); |
80 | } | |
81 | ||
82 | } |