FileDocCategorySizeDatePackage
NullPrinter.javaAPI DocExample1482Thu Nov 08 00:23:46 GMT 2001com.ora.rmibook.chapter3.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;