ann.easyio.Screen

 

Screen.java, a class to simplify Java output.

 

 

public Screen()

Default Screen constructor

Returns nothing, but I am ready for use.

 

public Screen println()

println() displays a newline.

Precondition: System.out is open;

Postcondition: a newline has been appended to System.out.

Return: the receiver

 

public Screen print(Object obj)

print(Object) displays an object using its toString() method.

Receives: an object to print.

Precondition: obj has defined method toString()

Postcondition: obj's String representation has been displayed.

Return: the receiver

 

public Screen println(Object obj)

println(Object) displays an object using its toString() method.

Receives: an object to print.

Precondition: obj has defined method toString()

Postcondition: obj's String representation has been displayed, followed by a newline.

Return: the receiver

 

public Screen print(char value)

print(char) displays a char.

Receives: a character to print.

Precondition: System.out is open; value is a char.

Postcondition: value has been appended to System.out.

Return: the receiver

 

public Screen println(char value)

println(char) displays a char followed by a newline.

Receives: a character to print.

Precondition: System.out is open; value is a char.

Postcondition: value and a newline have been appended to System.out.

Return: the receiver

 

public Screen print(String value)

print(string) displays a string.

Receives: a string to print.

Precondition: System.out is open; value is a string.

Postcondition: value has been appended to System.out.

Return: the receiver

 

public Screen println(String value)

println(string) displays a string followed by a newline.

Receives: a string to print.

Precondition: System.out is open; value is a string.

Postcondition: value and a newline have been appended to System.out.

Return: the receiver

 

public Screen print(boolean value)

print(boolean) displays a boolean.

Receives: a boolean to print.

Precondition: System.out is open; value is a boolean.

Postcondition: value has been appended to System.out.

Return: the receiver

 

public Screen println(boolean value)

println(boolean) displays a boolean followed by a newline.

Receives: a boolean to print.

Precondition: System.out is open; value is a boolean.

Postcondition: value and a newline have been appended to System.out.

Return: the receiver

 

public Screen print(byte value)

print(byte) displays a byte.

Receives: a byte to print.

Precondition: System.out is open; value is a byte.

Postcondition: value has been appended to System.out.

Return: the receiver

 

public Screen println(byte value)

println(byte) displays a byte followed by a newline.

Receives: a byte to print.

Precondition: System.out is open; value is a byte.

Postcondition: value and a newline have been appended to System.out.

Return: the receiver

 

public Screen print(short value)

print(short) displays a short.

Receives: a short integer to print.

Precondition: System.out is open; value is a short.

Postcondition: value has been appended to System.out.

Return: the receiver

 

public Screen println(short value)

println(short) displays a short followed by a newline.

Receives: a short integer to print.

Precondition: System.out is open; value is a short.

Postcondition: value and a newline have been appended to System.out.

Return: the receiver

 

public Screen print(int value)

print(int) displays an int.

Receives: an integer to print.

Precondition: System.out is open; value is an int.

Postcondition: value has been appended to System.out.

Return: the receiver

 

public Screen println(int value)

println(int) displays an int followed by a newline.

Receives: an integer to print.

Precondition: System.out is open; value is an int.

Postcondition: value and a newline have been appended to System.out.

Return: the receiver

 

public Screen print(long value)

print(long) displays a short.

Receives: a long integer to print.

Precondition: System.out is open; value is a long.

Postcondition: value has been appended to System.out.

Return: the receiver

 

public Screen println(long value)

println(long) displays a long followed by a newline.

Receives: a long integer to print.

Precondition: System.out is open; value is a long.

Postcondition: value and a newline have been appended to System.out.

Return: the receiver

 

public Screen print(float value)

print(float) displays a float.

Receives: a floating point value to print.

Precondition: System.out is open; value is a float.

Postcondition: value has been appended to System.out.

Return: the receiver

 

public Screen println(float value)

println(float) displays a float followed by a newline.

Receives: a floating point value to print.

Precondition: System.out is open; value is a float.

Postcondition: value and a newline have been appended to System.out.

Return: the receiver

 

public Screen print(double value)

print(double) displays a double.

Receives: a double precision floating point value to print.

Precondition: System.out is open; value is a double.

Postcondition: value has been appended to System.out.

Return: the receiver

 

public Screen println(double value)

println(double) displays a double followed by a newline.

Receives: a double precision floating point value to print.

Precondition: System.out is open; value is a double.

Postcondition: value and a newline have been appended to System.out.

Return: the receiver

 

public Screen printFormatted(double value)

printFormatted(double) displays a double using the default format.

Receives: a double precision floating point value to print.

Precondition: System.out is open; value is a double.

Postcondition: value has been appended to System.out.

Return: the receiver

 

public Screen printFormatted(double value, int decimalDigits)

printFormatted(double, int) displays a double with a given number of decimal digits.

Receives: value, a double, decimalDigits, an int.

Precondition: System.out is open; value is a double; decimalDigits > 0.

Postcondition: value has been appended to System.out, with decimalDigits right of the decimal.

Return: the receiver

 

public Screen printFormatted(double value, int integerPlaces, int decimalDigits)

printFormatted(double, int, int) displays a double with a given number of places left and right of the decimal.

Receives: value, a double; integerPlaces, an int; decimalDigits, an int

Precondition: System.out is open; integerPlaces > 0 && decimalDigits > 0.

Postcondition: value has been appended to System.out, with integerPlaces left of the decimal (leading zeros replaced by blanks), and decimalDigits to the right of the decimal.

Return: the receiver

 

public Screen printFormatted(double value, int integerDigits, int decimalDigits, char fillChar)

printFormatted(double, int, int, char) displays a double with a given number of integer and decimal places.

Receives: value, a double; integerDigits, an int; decimalDigits, an int; fillChar, a char.

Precondition: System.out is open; integerPlaces > 0 && decimalDigits > 0.

Postcondition: value has been appended to System.out, with integerDigits left of the decimal(leading zeros and separators replaced by fillChar), and decimalDigits to the right of the decimal.

Return: the receiver

 

 


Back to the package documentation index


Back to the Introduction


Copyright 2000 by Prentice Hall. All rights reserved.