/* * PatList.java * * Created on October 19, 2005, 11:00 PM */ package Current.search.basic; import java.util.*; import Current.basic.*; /** * This is a replacement for java.util.LinkedList as needed by the Slalom Search. * I hope it will run faster. * @author pat */ public class ComplexList { public LinkedList lst; // we think of this as ordered data public ComplexList() { lst=new LinkedList(); } public final Complex[] extractData(){ // Complex[] ret=new Complex[lst.size()]; // int i=0; // for (ListIterator it=lst.listIterator(); it.hasNext(); ) { // ret[i++]=(Complex)(it.next()); // } // return ret; return (Complex[])(lst.toArray(new Complex[lst.size()])); } /** replaces the data stored in this PatList with the data in * this array */ public final void replaceData(Complex data[]){ lst=new LinkedList(); for (int i=0; i