View Javadoc

1   /*
2    * $Id: ChatString.java 19191 2010-08-25 21:05:23Z tcarlson $
3    * --------------------------------------------------------------------------------------
4    * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.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       */
30      public StringBuffer append(String str)
31      {
32          return string.append(str);
33      }
34  
35      /**
36       * @param sb
37       */
38      public StringBuffer append(StringBuffer sb)
39      {
40          return string.append(sb);
41      }
42  
43      /**
44       * @param offset
45       * @param str
46       */
47      public StringBuffer insert(int offset, char[] str)
48      {
49          return string.insert(offset, str);
50      }
51  
52      /**
53       * @param index
54       * @param str
55       * @param offset
56       * @param len
57       */
58      public StringBuffer insert(int index, char[] str, int offset, int len)
59      {
60          return string.insert(index, str, offset, len);
61      }
62  
63      @Override
64      public String toString()
65      {
66          return string.toString();
67      }
68  
69      public int getSize()
70      {
71          return string.length();
72      }
73  
74  }