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