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

Constructor Index

 o TextOutputStream(String)
Constructs a text output stream that sends its output to a file

Method Index

 o close()
Closes the stream
 o fail()
Tests if the output stream is no longer valid
 o print(char)
Prints a character to a stream
 o print(double)
Prints a double precision floating point number to a stream
 o print(long)
Prints a long integer to a stream
 o print(Object)
Prints an object to a stream.
 o print(String)
Prints a string to a stream
 o printf(String, char)
Prints a character to a stream, with formatting instructions
 o printf(String, double)
Prints a double precision floating point number to a stream, with formatting instructions
 o printf(String, long)
Prints a long integer to a stream, with formatting instructions
 o printf(String, String)
Prints a string to a stream, with formatting instructions
 o println()
Prints a newline
 o println(char)
Prints a character to a stream, followed by a newline
 o println(double)
Prints a double precision floating point number to a stream, followed by a newline
 o println(long)
Prints a long integer to a stream, followed by a newline
 o println(Object)
Prints an object to a stream, followed by a newline.
 o println(String)
Prints a string to a stream, followed by a newline
 o write(int)
Writes one byte to the stream

Constructors

 o TextOutputStream
  public TextOutputStream(String s)
Constructs a text output stream that sends its output to a file
Parameters:
s - the file name

Methods

 o fail
  public boolean fail()
Tests if the output stream is no longer valid
Returns:
true if the stream has failed
 o close
  public void close()
Closes the stream
Overrides:
close in class OutputStream
 o write
  public void write(int b)
Writes one byte to the stream
Parameters:
b - the byte to write
Overrides:
write in class OutputStream
 o print
  public void print(String s)
Prints a string to a stream
Parameters:
s - the string to print
 o print
  public void print(char c)
Prints a character to a stream
Parameters:
c - the character to print
 o 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
 o print
  public void print(long l)
Prints a long integer to a stream
Parameters:
l - the number to print
 o print
  public void print(double x)
Prints a double precision floating point number to a stream
Parameters:
l - the number to print
 o println
  public void println(String s)
Prints a string to a stream, followed by a newline
Parameters:
s - the string to print
 o println
  public void println(char c)
Prints a character to a stream, followed by a newline
Parameters:
c - the character to print
 o 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
 o println
  public void println(long l)
Prints a long integer to a stream, followed by a newline
Parameters:
l - the number to print
 o 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
 o println
  public void println()
Prints a newline
 o 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
 o 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
 o 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
 o 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