gvsu/cs621/proj3/PrintSpooler.java
josh 8818779daf commented, calculating interests
git-svn-id: svn://anubis/gvsu@74 45c1a28c-8058-47b2-ae61-ca45b979098e
2008-03-21 20:48:42 +00:00

30 lines
652 B
Java

/**
* A class implementing the "singleton" design pattern for printing.
*/
public class PrintSpooler
{
/* The reference to the single PrintSpooler object
* that will be used to print */
private static PrintSpooler spooler;
/**
* This method returns the singleton to use for printing documents.
*/
public static PrintSpooler getSpooler()
{
if (spooler == null)
spooler = new PrintSpooler();
return spooler;
}
/**
* Print a document
* @param s the document (string) to print
*/
public void printDocument(String s)
{
System.out.println(s);
}
}