Site hosted by Angelfire.com: Build your free website today!

public class ArrayQueue{ private Object[] queueList; private int front, back; public ArrayQueue() { queueList = new Object[5]; front = 0; back = 0; } public void addItem( Object newValue ) { if ( front + queueList.length() == back ) { this.expand(); } queueList[ back ] = newValue; back++; } public void expand() { private Object[] tempArray; tempArray[] = new Object[ queueList.length * 2 ]; for ( i = front, i < back, i++ ) { tempArray[ i - front ] = queueList[ i % queueList.length ]; } front = 0; back = queueList.length; queueList = tempArray; } public Object removeItem() { Object sendBack; if ( front == back ) { sendBack = null; } else { sendBack = Object[ front ]; front++; } return sendBack; } } public class Data implements Comparable{ public String name; public int id; public Data( String givenName, int givenID ) { this.name = givenName; this.id = givenID; } public int compareTo( Object other ) { Data otherData = (Data) other; Return this.id - otherData.id; } public String toString() { return id + "\t" + name; } } import java.io.*; public class Arranger{ public static void main( String[] args ) throws IOException { if ( args.length != 2 ) { System.exit(0); } File inputFileA, inputFileL; inputFileA = new File( args[0] ); inputFileL = new File( args[1] ); BufferedReader arrayReader = null, linkedReader = null; arrayReader = new BufferedReader( new FileReader( inputFileA ) ); linkedReader = new BufferedReader( new FileReader( inputFileL ) ); ArrayQueue dataQueueA; dataQueueA = new ArrayQueue(); While arrayReader.ready() { StringTokenizer st; Data newItem; int id; String name; st = new StringTokenizer( arrayReader.readLine() ); id = Integer.parseInt( st.nextToken() ); name = st.nextToken(); newItem = new Data( name, id ) //TEMP System.out.println( "Blargh!" ); System.out.println( linkedReader.readLine() ); System.out.println( "Blargh!" ); //TEMP } }