|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object Out
public class Out
Simple output to the console and to files.
Copyright (c) 2005 Hanspeter Moessenboeck, University of Linz
This class is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version.
This class is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
This class allows printing formatted data either to the console or to a file. It is intended to be used in an introductory programming course when classes, packages and exceptions are unknown at the beginning. To use it, simply copy Out.class into the current directory.
All output goes to the current output file, which is initially the console. Opening a file with open() makes it the new current output file. Closing a file with close() switches back to the previous output file.
Constructor Summary | |
---|---|
Out()
|
Method Summary | |
---|---|
static void |
close()
Close the current output file. |
static boolean |
done()
Return true if the previous Out operation was successful, otherwise return false. |
static void |
open(java.lang.String fn)
Open the file with the name fn as the current output file. |
static void |
print(boolean b)
Print the boolean value b either as "true" or "false". |
static void |
print(char s)
Print the character value c. |
static void |
print(char[] a)
Print the character array a. |
static void |
print(double d)
Print the double value d. |
static void |
print(float f)
Print the float value f. |
static void |
print(int i)
Print the integer value i. |
static void |
print(long l)
Print the long value l. |
static void |
print(java.lang.Object o)
Print the Object o as resulting from String.valueOf(o). |
static void |
print(java.lang.String s)
Print the String s. |
static void |
println()
Terminate the current line by writing a line separator string. |
static void |
println(boolean b)
Print the boolean value b and terminate the line. |
static void |
println(char s)
Print the character value c and terminate the line. |
static void |
println(char[] a)
Print the character array a and terminate the line. |
static void |
println(double d)
Print the double value d and terminate the line. |
static void |
println(float f)
Print the float value f and terminate the line. |
static void |
println(int i)
Print the integer value i and terminate the line. |
static void |
println(long l)
Print the long value l and terminate the line. |
static void |
println(java.lang.Object o)
Print the Object o as resulting from String.valueOf(o) and terminate the line. |
static void |
println(java.lang.String s)
Print the String s and terminate the line. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Out()
Method Detail |
---|
public static boolean done()
public static void print(boolean b)
public static void print(char s)
public static void print(int i)
public static void print(long l)
public static void print(float f)
public static void print(double d)
public static void print(char[] a)
public static void print(java.lang.String s)
public static void print(java.lang.Object o)
public static void println()
public static void println(boolean b)
public static void println(char s)
public static void println(int i)
public static void println(long l)
public static void println(float f)
public static void println(double d)
public static void println(char[] a)
public static void println(java.lang.String s)
public static void println(java.lang.Object o)
public static void open(java.lang.String fn)
public static void close()
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |