101 * is greater than {@code end}, or {@code end} is greater than
102 * {@code csq.length()}
103 *
104 * @throws IOException
105 * If an I/O error occurs
106 */
107 Appendable append(CharSequence csq, int start, int end) throws IOException;
108
109 /**
110 * Appends the specified character to this {@code Appendable}.
111 *
112 * @param c
113 * The character to append
114 *
115 * @return A reference to this {@code Appendable}
116 *
117 * @throws IOException
118 * If an I/O error occurs
119 */
120 Appendable append(char c) throws IOException;
121 }
|
101 * is greater than {@code end}, or {@code end} is greater than
102 * {@code csq.length()}
103 *
104 * @throws IOException
105 * If an I/O error occurs
106 */
107 Appendable append(CharSequence csq, int start, int end) throws IOException;
108
109 /**
110 * Appends the specified character to this {@code Appendable}.
111 *
112 * @param c
113 * The character to append
114 *
115 * @return A reference to this {@code Appendable}
116 *
117 * @throws IOException
118 * If an I/O error occurs
119 */
120 Appendable append(char c) throws IOException;
121
122 /**
123 * Appends {@code n} copies of the specified character to this
124 * {@code Appendable}.
125 *
126 * @param c
127 * The character to append
128 * @param n
129 * The number of copies
130 *
131 * @return A reference to this {@code Appendable}
132 *
133 * @throws IOException
134 * If an I/O error occurs
135 * @throws IllegalArgumentException
136 * If {@code n} is negative
137 */
138 default Appendable appendN(char c, int n) throws IOException {
139 if (n < 0) {
140 throw new IllegalArgumentException("Negative number of"
141 + " copies: " + n);
142 }
143 StringBuilder sb = new StringBuilder(n);
144 return append(sb.appendN(c, n));
145 }
146 }
|