View Javadoc

1   /*
2    * $Id: ChatString.java 10789 2008-02-12 20:04:43Z dfeist $
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.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      /**
21       * Serial version
22       */
23      private static final long serialVersionUID = -3140370545357738491L;
24  
25      private StringBuffer string = new StringBuffer();
26  
27      /**
28       * @param str
29       * @return
30       */
31      public StringBuffer append(String str)
32      {
33          return string.append(str);
34      }
35  
36      /**
37       * @param sb
38       * @return
39       */
40      public StringBuffer append(StringBuffer sb)
41      {
42          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          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          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          return string.toString();
75      }
76  
77      public int getSize()
78      {
79          return string.length();
80      }
81  
82  }