Class ccj.TextOutputStream
All Packages Class Hierarchy This Package Previous Next Index
Class ccj.TextOutputStream
java.lang.Object
|
+----java.io.OutputStream
|
+----ccj.TextOutputStream
- public class TextOutputStream
- extends OutputStream
-
TextOutputStream(String)
- Constructs a text output stream that sends its output to a file
-
close()
- Closes the stream
-
fail()
- Tests if the output stream is no longer valid
-
print(char)
- Prints a character to a stream
-
print(double)
- Prints a double precision floating point number to a stream
-
print(long)
- Prints a long integer to a stream
-
print(Object)
- Prints an object to a stream.
-
print(String)
- Prints a string to a stream
-
printf(String, char)
- Prints a character to a stream, with formatting instructions
-
printf(String, double)
- Prints a double precision floating point number to a stream, with formatting instructions
-
printf(String, long)
- Prints a long integer to a stream, with formatting instructions
-
printf(String, String)
- Prints a string to a stream, with formatting instructions
-
println()
- Prints a newline
-
println(char)
- Prints a character to a stream, followed by a newline
-
println(double)
- Prints a double precision floating point number to a stream, followed by a newline
-
println(long)
- Prints a long integer to a stream, followed by a newline
-
println(Object)
- Prints an object to a stream, followed by a newline.
-
println(String)
- Prints a string to a stream, followed by a newline
-
write(int)
- Writes one byte to the stream
TextOutputStream
public TextOutputStream(String s)
- Constructs a text output stream that sends its output to a file
- Parameters:
- s - the file name
fail
public boolean fail()
- Tests if the output stream is no longer valid
- Returns:
- true if the stream has failed
close
public void close()
- Closes the stream
- Overrides:
- close in class OutputStream
write
public void write(int b)
- Writes one byte to the stream
- Parameters:
- b - the byte to write
- Overrides:
- write in class OutputStream
print
public void print(String s)
- Prints a string to a stream
- Parameters:
- s - the string to print
print
public void print(char c)
- Prints a character to a stream
- Parameters:
- c - the character to print
print
public void print(Object o)
- Prints an object to a stream. The toString method of the object is invoked
- Parameters:
- o - the object to print
print
public void print(long l)
- Prints a long integer to a stream
- Parameters:
- l - the number to print
print
public void print(double x)
- Prints a double precision floating point number to a stream
- Parameters:
- l - the number to print
println
public void println(String s)
- Prints a string to a stream, followed by a newline
- Parameters:
- s - the string to print
println
public void println(char c)
- Prints a character to a stream, followed by a newline
- Parameters:
- c - the character to print
println
public void println(Object o)
- Prints an object to a stream, followed by a newline. The toString method of the object is invoked
- Parameters:
- o - the object to print
println
public void println(long l)
- Prints a long integer to a stream, followed by a newline
- Parameters:
- l - the number to print
println
public void println(double x)
- Prints a double precision floating point number to a stream, followed by a newline
- Parameters:
- l - the number to print
println
public void println()
- Prints a newline
printf
public void printf(String fmt,
double x)
- Prints a double precision floating point number to a stream, with formatting instructions
- Parameters:
- fmt - the formatting instruction string.
The string has a prefix, a format code and a suffix. The prefix and suffix
become part of the formatted output. The format code directs the
formatting of the parameter to be formatted. The code has the
following structure
- a % (required)
- a modifier (optional)
- +
- forces display of + for positive numbers
- 0
- show leading zeroes
- -
- align left in the field
- space
- prepend a space in front of positive numbers
- #
- use "alternate" format: Don't suppress trailing zeroes in general floating point format.
- an integer denoting field width (optional)
- a period followed by an integer denoting precision (optional)
- a format descriptor (required)
- f
- floating point number in fixed format
- e, E
- floating point number in exponential notation (scientific format). The E format results in an uppercase E for the exponent (1.14130E+003), the e format in a lowercase e.
- g, G
- floating point number in general format (fixed format for small numbers, exponential format for large numbers). Trailing zeroes are suppressed. The G format results in an uppercase E for the exponent (if any), the g format in a lowercase e.
- l - the number to print
printf
public void printf(String fmt,
long x)
- Prints a long integer to a stream, with formatting instructions
- Parameters:
- fmt - the formatting instruction string.
The string has a prefix, a format code and a suffix. The prefix and suffix
become part of the formatted output. The format code directs the
formatting of the parameter to be formatted. The code has the
following structure
- a % (required)
- a modifier (optional)
- +
- forces display of + for positive numbers
- 0
- show leading zeroes
- -
- align left in the field
- space
- prepend a space in front of positive numbers
- #
- use "alternate" format: Add 0 or 0x for octal or hexadecimal numbers.
- an integer denoting field width (optional)
- a format descriptor (required)
- d, i
- integer in decimal
- x
- integer in hexadecimal
- o
- integer in octal
- x - the number to print
printf
public void printf(String fmt,
char x)
- Prints a character to a stream, with formatting instructions
- Parameters:
- fmt - the formatting instruction string.
The string has a prefix, a format code and a suffix. The prefix and suffix
become part of the formatted output. The format code directs the
formatting of the parameter to be formatted. The code has the
following structure
- a % (required)
- a modifier (optional)
- +
- forces display of + for positive numbers
- 0
- show leading zeroes
- -
- align left in the field
- space
- prepend a space in front of positive numbers
- #
- use "alternate" format: Add 0 or 0x for octal or hexadecimal numbers.
- an integer denoting field width (optional)
- a format descriptor (required)
- d, i
- integer in decimal
- x
- integer in hexadecimal
- o
- integer in octal
- c
- character
- x - the character to print
printf
public void printf(String fmt,
String x)
- Prints a string to a stream, with formatting instructions
- Parameters:
- fmt - the formatting instruction string.
The string has a prefix, a format code and a suffix. The prefix and suffix
become part of the formatted output. The format code directs the
formatting of the parameter to be formatted. The code has the
following structure
- a % (required)
- a modifier (optional)
- -
- align left in the field
- an integer denoting field width (optional)
- a format descriptor (required)
- s
- string
- x - the character to print
All Packages Class Hierarchy This Package Previous Next Index