Index: ChangeLog =================================================================== RCS file: /cvsroot/classpath/classpath/ChangeLog,v retrieving revision 1.2386.2.21 diff -u -3 -p -u -r1.2386.2.21 ChangeLog --- ChangeLog 18 Sep 2004 23:02:31 -0000 1.2386.2.21 +++ ChangeLog 26 Sep 2004 21:16:54 -0000 @@ -1,3 +1,9 @@ +2004-09-26 Andrew John Hughes + + * java/lang/Appendable.java + Documented this class. + (append(CharSequence, int, int)): added. + 2004-09-18 Tom Tromey * java/lang/annotation/Retention.java: Documented. Index: java/lang/Appendable.java =================================================================== RCS file: /cvsroot/classpath/classpath/java/lang/Attic/Appendable.java,v retrieving revision 1.1.2.1 diff -u -3 -p -u -r1.1.2.1 Appendable.java --- java/lang/Appendable.java 7 Aug 2004 00:27:06 -0000 1.1.2.1 +++ java/lang/Appendable.java 26 Sep 2004 21:16:54 -0000 @@ -37,8 +37,80 @@ exception statement from your version. * package java.lang; +/** + *

+ * An Appendable object is one to which a sequence of Unicode + * characters can be added. The appended characters must be valid Unicode + * characters, and may include supplementary characters, composed of multiple + * 16-bit char values. + *

+ *

+ * The behaviour of the Appendable object is heavily dependent + * on the particular implementation being used. Some implementations may be + * thread-safe, while others may not. Likewise, some implementing classes + * may produce errors which aren't propogated to the invoking class, due + * to differences in the error handling used. + *

+ *

+ * Note: implementation of this interface is required for + * any class that wishes to receive data from a Formatter instance. + *

+ * + * @author Tom Tromey + * @author Andrew John Hughes + * @since 1.5 + */ public interface Appendable { + + /** + * Appends the Unicode character, c, to this Appendable + * object. + * + * @param c the character to append. + * @return a reference to this object. + * @throws IOException if an I/O error occurs. + */ Appendable append(char c); + + /** + * Appends the specified sequence of Unicode characters to this + * Appendable object. The entire sequence may not + * be appended, if constrained by the underlying implementation. + * For example, a buffer may reach its size limit before the entire + * sequence is appended. + * + * @param seq the character sequence to append. If seq is null, + * then the string "null" (the string representation of null) + * is appended. + * @return a reference to this object. + * @throws IOException if an I/O error occurs. + */ Appendable append(CharSequence seq); + + /** + * Appends the specified subsequence of Unicode characters to this + * Appendable object, starting and ending at the specified + * positions within the sequence. The entire sequence may not + * be appended, if constrained by the underlying implementation. + * For example, a buffer may reach its size limit before the entire + * sequence is appended. The behaviour of this method matches the + * behaviour of append(seq.subSequence(start,end)) when + * the sequence is not null. + * + * @param seq the character sequence to append. If seq is null, + * then the string "null" (the string representation of null) + * is appended. + * @param start the index of the first Unicode character to use from + * the sequence. + * @param end the index of the last Unicode character to use from the + * sequence. + * @return a reference to this object. + * @throws IOException if an I/O error occurs. + * @throws IndexOutOfBoundsException if either of the indices are negative, + * the start index occurs after the end index, or the end index is + * beyond the end of the sequence. + */ + Appendable append(CharSequence seq, int start, int end); + }