Console

Printing to Standard Output

The following functions are defined in the pnuts.lib module. The names of functions are simillar to methods of PrintWriter class.

println(Object objects, ...)
print(Object objects, ...)
printAll(Enumeration enum) or
(Iterator iterator) or
(Generator generator) or
(Collection collection)
(array[])
write(byte[] array , int offset , int length) or
(char[] array , int offset , int length)
write(byte[] array) or
(char[] array)
flush()

print() displays objects one by one. println() additionally appends "line.separator" to the stream. write() just calls a method "write" of the stream class.

flush() flushes the buffered data.

printAll() prints all elements of the parameter.

getWriter()

getWriter() returns the PrintWriter object on which console messages are printed.

Reporting errors

error(String string {, Context context })

error() displays an error message. If context is specified the message is written to the error stream of the context.

getErrorWriter()

getErrorWriter() returns the current PrintWriter object on which error messages are printed.

setVerbose( boolean verbose )

setVerbose() turns on/off the verbose mode.