FileDocCategorySizeDatePackage
NullPrinter.javaAPI DocExample1733Thu Nov 08 00:22:48 GMT 2001com.ora.rmibook.chapter12.printer.printers

NullPrinter

public class NullPrinter extends Object implements Printer

Fields Summary
private PrintWriter
_log
Constructors Summary
public NullPrinter(OutputStream log)

        _log = new PrintWriter(log);
    
Methods Summary
public booleanprintDocument(DocumentDescription documentDescription)

        if (null == _log) {
            throw new NoLogException();
        }
        if (null == documentDescription) {
            throw new NoDocumentException();
        }
        _log.println("Printed file");
        _log.flush();
        if (_log.checkError()) {
            throw new CantWriteToLogException();
        }
        return true;
    
public booleanprinterAvailable()

        return true;