FileDocCategorySizeDatePackage
DListTest.javaAPI DocGlassfish v2 API3978Fri May 04 22:32:10 BST 2007com.sun.enterprise.util.collection

DListTest

public class DListTest extends Object

$Source: /cvs/glassfish/appserv-commons/src/java/com/sun/enterprise/util/collection/DListTest.java,v $
author
$Author: tcfujii $
version
$Revision: 1.4 $ $Date: 2007/05/05 05:32:10 $

Fields Summary
Constructors Summary
Methods Summary
public static voidmain(java.lang.String[] args)

    	
    	int count = 20;
    	long time=0, t1=0, t2 = 0;
    	String data = "SomeData_";

		SortedArrayListBucket bucket = new SortedArrayListBucket();
		for (int i=0; i<count; i+= 5) {
			bucket.put(i, data + i);
		}
		
		for (int i=1; i<count; i+= 3) {
			bucket.put(i, data + i);
		}
		
		for (int i=3; i<count; i+= 4) {
			bucket.put(i, data + i);
		}
		
		for (int i=-23; i<count; i+= 4) {
			bucket.put(i, data + i);
		}
    	IntEntry entry = null;
    	Iterator iter = bucket.entryIterator();
    	while (iter.hasNext()) {
    		entry = (IntEntry) iter.next();
    		System.out.println(entry);
    	}
    		
		
    	t1 = System.currentTimeMillis();
    	for (int i=0; i<1000000; i++) {
    		for (int j=-25; j<25; j++) {
    			bucket.get(j);
    		}
    	}
    	t2 = System.currentTimeMillis();
    	System.out.println("llist.remove(): " + ((t2 - t1) / 1000.0) + " seconds " + time);
    	//32.968