|
Oracle Fusion Middleware Java API Reference for Oracle ADF Mobile Client 11g Release 1 (11.1.1) E17503-02 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.io.Writer
oracle.adfnmc.java.io.Writer
oracle.adfnmc.java.io.StringWriter
public class StringWriter
StringWriter is an class for writing Character Streams to a StringBuffer. The characters written can then be returned as a String. This is used for capturing output sent to a Writer by substituting a StringWriter.
StringReader
Field Summary |
---|
Fields inherited from class oracle.adfnmc.java.io.Writer |
---|
lock |
Constructor Summary | |
---|---|
StringWriter()
Constructs a new StringWriter which has a StringBuffer allocated with the default size of 16 characters. |
|
StringWriter(int initialSize)
Constructs a new StringWriter which has a StringBuffer allocated with the size of initialSize
characters. |
Method Summary | |
---|---|
Writer |
append(char c)
Append a char c to the StringWriter. |
Writer |
append(java.lang.String csq)
Append a CharSequence csq to the StringWriter. |
Writer |
append(java.lang.String csq,
int start,
int end)
Append a subsequence of a CharSequence csq to the StringWriter. |
void |
close()
Close this Writer. |
void |
flush()
Flush this Writer. |
java.lang.StringBuffer |
getBuffer()
Answer the contents of this StringWriter as a StringBuffer. |
java.lang.String |
toString()
Answer the contents of this StringWriter as a String. |
void |
write(char[] cbuf,
int offset,
int count)
Writes count characters starting at offset in cbuf to this StringWriter. |
void |
write(int oneChar)
Writes the specified character oneChar to this StringWriter. |
void |
write(java.lang.String str)
Writes the characters from the String str to this StringWriter. |
void |
write(java.lang.String str,
int offset,
int count)
Writes count number of characters starting at offset from the String str to
this StringWriter. |
Methods inherited from class oracle.adfnmc.java.io.Writer |
---|
write |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public StringWriter()
lock
used to synchronize access to this Writer.
public StringWriter(int initialSize)
initialSize
characters. The StringBuffer is also the lock
used to synchronize access to this Writer.
initialSize
- the intial number of charactersMethod Detail |
---|
public void close() throws java.io.IOException
close
in interface Closeable
close
in class Writer
java.io.IOException
- If an IO error occurs closing this StringWriter.public void flush()
flush
in interface Flushable
flush
in class Writer
public java.lang.StringBuffer getBuffer()
public java.lang.String toString()
toString
in class java.lang.Object
public void write(char[] cbuf, int offset, int count)
count
characters starting at offset
in cbuf
to this StringWriter.
write
in class Writer
cbuf
- the non-null array containing characters to write.offset
- offset in buf to retrieve characterscount
- maximum number of characters to write
java.lang.ArrayIndexOutOfBoundsException
- If offset or count are outside of bounds.public void write(int oneChar)
oneChar
to this StringWriter. This implementation writes the low order
two bytes to the Stream.
write
in class Writer
oneChar
- The character to writepublic void write(java.lang.String str)
str
to this StringWriter.
write
in class Writer
str
- the non-null String containing the characters to write.public void write(java.lang.String str, int offset, int count)
count
number of characters starting at offset
from the String str
to
this StringWriter.
write
in class Writer
str
- the non-null String containing the characters to write.offset
- the starting point to retrieve characters.count
- the number of characters to retrieve and write.
java.lang.ArrayIndexOutOfBoundsException
- If offset or count are outside of bounds.public Writer append(char c)
c
to the StringWriter. The StringWriter.append(c
) works the same way as
StringWriter.write(c
).
append
in class Writer
c
- The character appended to the StringWriter.
public Writer append(java.lang.String csq)
csq
to the StringWriter. The StringWriter.append(csq
) works the
same way as StringWriter.write(csq
.toString()). If csq
is null, then "null" will be
substituted for csq
.
csq
- The CharSequence appended to the StringWriter.
public Writer append(java.lang.String csq, int start, int end)
csq
to the StringWriter. The first char and the last char of
the subsequnce is specified by the parameter start
and end
. The StringWriter.append(
csq
) works the same way as StringWriter.write(csq
.subSequence(start
,
end
).toString).If csq
is null, then "null" will be substituted for csq
. s
csq
- The CharSequence appended to the StringWriter.start
- The index of the first char in the CharSequence appended to the StringWriter.end
- The index of the char after the last one in the CharSequence appended to the StringWriter.
java.lang.IndexOutOfBoundsException
- If start is less than end, end is greater than the length of the CharSequence, or start or end is
negative.
|
Oracle Fusion Middleware Java API Reference for Oracle ADF Mobile Client 11g Release 1 (11.1.1) E17503-02 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |