示例#1
0
 /**
  * Appends a subsequence of the character sequence {@code csq} to the target
  * stream. This method works the same way as {@code
  * PrintStream.print(csq.subsequence(start, end).toString())}. If {@code
  * csq} is {@code null}, then the specified subsequence of the string "null"
  * will be written to the target stream.
  *
  * @param csq
  *            the character sequence appended to the target stream.
  * @param start
  *            the index of the first char in the character sequence appended
  *            to the target stream.
  * @param end
  *            the index of the character following the last character of the
  *            subsequence appended to the target stream.
  * @return this stream.
  * @throws IndexOutOfBoundsException
  *             if {@code start > end}, {@code start < 0}, {@code end < 0} or
  *             either {@code start} or {@code end} are greater or equal than
  *             the length of {@code csq}.
  */
 public PrintStream append(java.lang.CharSequence csq, int start, int end)
 {
     if (null == csq)
     {
         print(TOKEN_NULL.substring(start, end));
     }
     else
     {
         print(csq.subSequence(start, end).toString());
     }
     return(this);
 }
示例#2
0
 /*
  * Appends a subsequence of the character sequence {@code csq} to the
  * target. This method works the same way as {@code
  * Writer.writer(csq.subsequence(start, end).toString())}. If {@code
  * csq} is {@code null}, then the specified subsequence of the string "null"
  * will be written to the target.
  *
  * @param csq
  *            the character sequence appended to the target.
  * @param start
  *            the index of the first char in the character sequence appended
  *            to the target.
  * @param end
  *            the index of the character following the last character of the
  *            subsequence appended to the target.
  * @return this writer.
  * @throws IOException
  *             if this writer is closed or another I/O error occurs.
  * @throws IndexOutOfBoundsException
  *             if {@code start > end}, {@code start < 0}, {@code end < 0} or
  *             either {@code start} or {@code end} are greater or equal than
  *             the length of {@code csq}.
  */
 public virtual Writer append(java.lang.CharSequence csq, int start, int end)
 {//throws IOException {
     if (null == csq)
     {
         write(TOKEN_NULL.substring(start, end));
     }
     else
     {
         write(csq.subSequence(start, end).toString());
     }
     return(this);
 }
示例#3
0
 /*
  * Writes chars of the given {@code CharSequence} to the current position of
  * this buffer, and increases the position by the number of chars written.
  *
  * @param csq
  *            the {@code CharSequence} to write.
  * @param start
  *            the first char to write, must not be negative and not greater
  *            than {@code csq.length()}.
  * @param end
  *            the last char to write (excluding), must be less than
  *            {@code start} and not greater than {@code csq.length()}.
  * @return this buffer.
  * @exception BufferOverflowException
  *                if {@code remaining()} is less than {@code end - start}.
  * @exception IndexOutOfBoundsException
  *                if either {@code start} or {@code end} is invalid.
  * @exception ReadOnlyBufferException
  *                if no changes may be made to the contents of this buffer.
  */
 public virtual CharBuffer append(java.lang.CharSequence csq, int start, int end)
 {
     if (csq == null)
     {
         //csq = "null";
         return(put("null"));
     }
     java.lang.CharSequence cs = csq.subSequence(start, end);
     if (cs.length() > 0)
     {
         return(put(cs.toString()));
     }
     else
     {
         return(this);
     }
 }
示例#4
0
 public override CharBuffer slice()
 {
     return(new CharSequenceAdapter(sequence.subSequence(positionJ, limitJ)));
 }