import clist.*; import clist.visitor.*; /** * Very simple-mimded test program. */ public class TestCircular { public static void main(String[] args) { CLList cll = new CLList (); System.out.print ("list is clockwise: "); cll.execClockwise (PrintClockwise.Singleton, cll, null); cll.insertClockwise(new Integer (5)); System.out.print ("list is clockwise: "); cll.execClockwise (PrintClockwise.Singleton, cll, null); cll.insertClockwise(new Integer (-99)); System.out.print ("list is clockwise: "); cll.execClockwise (PrintClockwise.Singleton, cll, null); cll.insertCounterwise(new Integer (48)); System.out.print ("list is clockwise: "); cll.execClockwise (PrintClockwise.Singleton, cll, null); System.out.println ("Removing counterclockwise " + cll.remCounterwise()); System.out.print ("list is clockwise: "); cll.execClockwise (PrintClockwise.Singleton, cll, null); System.out.println ("Removing clockwise " + cll.remClockwise()); System.out.print ("list is clockwise: "); cll.execClockwise (PrintClockwise.Singleton, cll, null); System.out.println ("Removing counterclockwise " + cll.remCounterwise()); System.out.print ("list is clockwise: "); cll.execClockwise (PrintClockwise.Singleton, cll, null); System.out.println ("Inserting elements ..."); cll.insertClockwise(new Integer (5)); System.out.print ("list is clockwise: "); cll.execClockwise (PrintClockwise.Singleton, cll, null); cll.insertClockwise(new Integer (70)); System.out.print ("list is clockwise: "); cll.execClockwise (PrintClockwise.Singleton, cll, null); cll.insertClockwise(new Integer (-99)); System.out.print ("list is clockwise: "); cll.execClockwise (PrintClockwise.Singleton, cll, null); cll.insertCounterwise(new Integer (48)); System.out.print ("list is clockwise: "); cll.execClockwise (PrintClockwise.Singleton, cll, null); System.out.println ("Removing clockwise the 2th element: " + cll.execClockwise (RemNthClockwise.Singleton, cll, new Integer (2))); System.out.print ("list is clockwise: "); cll.execClockwise (PrintClockwise.Singleton, cll, null); cll.insertClockwise(new Integer (100)); System.out.print ("list is clockwise: "); cll.execClockwise (PrintClockwise.Singleton, cll, null); System.out.println ("Removing clockwise the 3th element: " + cll.execClockwise (RemNthClockwise.Singleton, cll, new Integer (3))); System.out.print ("list is clockwise: "); cll.execClockwise (PrintClockwise.Singleton, cll, null); System.out.println ("Removing clockwise the 0th element: " + cll.execClockwise (RemNthClockwise.Singleton, cll, new Integer (0))); System.out.print ("list is clockwise: "); cll.execClockwise (PrintClockwise.Singleton, cll, null); System.out.println ("Removing clockwise the 0th element: " + cll.execClockwise (RemNthClockwise.Singleton, cll, new Integer (0))); System.out.print ("list is clockwise: "); cll.execClockwise (PrintClockwise.Singleton, cll, null); System.out.println ("Removing clockwise the 0th element: " + cll.execClockwise (RemNthClockwise.Singleton, cll, new Integer (0))); System.out.print ("list is clockwise: "); cll.execClockwise (PrintClockwise.Singleton, cll, null); } }