/** * SynchroTest.java - test the synchro list * * Copyright (C) 1998, Chuck McManis, All Rights Reserved. * * Permission to use, copy, modify, and distribute this software * and its documentation for NON-COMMERCIAL purposes and without * fee is hereby granted provided that this copyright notice * appears in all copies. * * CHUCK MCMANIS MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. CHUCK MCMANIS * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT * OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. */ import java.util.Enumeration; import java.util.Vector; public class SynchroTest { static int data[] = { 1, 0, 25, 20, 3, 45, 6, 2, 5, 17, 49, 24, 55, 12, 30, 31, 32, 33, 34, 45, 46, 47, 10, 40 }; public static void main(String args[]) { SynchroList sl = new SynchroList(new IntCompare()); Enumeration e1, e2; for (int i = 0; i < data.length; i++) { sl.add(new Integer(data[i])); } System.out.println("Total array size was "+sl.size()+" elements."); int lineNum = 1; for (Enumeration e = sl.elements(); e.hasMoreElements(); ) { Integer ii = (Integer)(e.nextElement()); System.out.println("ELEMENT["+lineNum+"] - "+ii); lineNum++; } } }