01 /*
02  *  JScripter Emulation 1.0 - To Script Java
03  *  Copyright (C) 2008-2011  J.J.Liu<jianjunliu@126.com> <http://www.jscripter.org>
04  *  
05  *  This program is free software: you can redistribute it and/or modify
06  *  it under the terms of the GNU Affero General Public License as published by
07  *  the Free Software Foundation, either version 3 of the License, or
08  *  (at your option) any later version.
09  *  
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 Affero General Public License for more details.
14  *  
15  *  You should have received a copy of the GNU Affero General Public License
16  *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
17  */
18 
19 package org.jscripter.emu.java.lang;
20 
21 /**
22  * <p><b>Internally</b> represents objects to which char sequences and values can
23  * be appended, emulating a standard <tt>java.lang</tt> interface or class with
24  * the same simple name as this one.</p>
25  * <p>This interface or class is only used internally by JS re-compiler implementations.</p>
26  * <p>Please refer to <a href="http://java.sun.com/docs/">the Java API Standards</a> for detail description of the original class or interface.</p>
27  * 
28  * @author <a href="mailto:jianjunliu@126.com">J.J.Liu (Jianjun Liu)</a> at <a href="http://www.jscripter.org" target="_blank">http://www.jscripter.org</a>
29  * 
30  * @javascript Re-compilers must redirect the resolution of the emulated original Java class or interface to this one.
31  */
32 public interface Appendable
33 {
34     /**
35      * <p>Appends the specified character sequence.</p>
36      * @param csq A character sequence to append.
37      * @return This object itself.
38      * @throws java.io.IOException if an I/O error occurs.
39      * @since 1.0
40      * @javascript Re-compilers must report error on end-users directly using this method.
41      */
42     Appendable append(CharSequence csq) throws java.io.IOException;
43 
44     /**
45      * <p>Appends the specified character.</p>
46      * 
47      * @param csq The character sequence from which a subsequence will be appended. If <tt>csq</tt> 
48      * is <tt>null</tt>, then characters will be appended as if <tt>csq</tt> contained the four
49      * characters "null".
50      * @param start The index of the first character in the subsequence.
51      * @param end The index of the character following the last character in the subsequence.
52      * @return This object itself.
53      * @throws java.io.IOException if an I/O error occurs.
54      * @since 1.0
55      * @javascript Re-compilers must report error on end-users directly using this method.
56      */
57     Appendable append(CharSequence csq, int start, int end) throws java.io.IOException;
58 
59     /**
60      * <p>Appends the specified character.</p>
61      * 
62      * @param c A character to append.
63      * @return This object itself.
64      * @throws java.io.IOException if an I/O error occurs.
65      * @since 1.0
66      * @javascript Re-compilers must report error on end-users directly using this method.
67      */
68     Appendable append(char c) throws java.io.IOException;
69 }