FileDocCategorySizeDatePackage
QueueTester.javaAPI DocExample690Wed May 05 17:15:14 BST 2004com.oreilly.tiger.ch01

QueueTester

public class QueueTester extends Object

Fields Summary
public Queue
q
Constructors Summary
public QueueTester()

    q = new LinkedList();
  
Methods Summary
public static voidmain(java.lang.String[] args)

    QueueTester tester = new QueueTester();

    try {
      tester.testFIFO(System.out);
    } catch (IOException e) {
      e.printStackTrace();
    } 
  
public voidtestFIFO(java.io.PrintStream out)

    q.add("First");
    q.add("Second");
    q.add("Third");

    Object o;
    while ((o = q.poll()) != null) {
      out.println(o);
    }