All pastes #493148 Raw Edit

Untitled

public java v1 · immutable
·published 2007-05-17 16:43 UTC
rendered paste body
import java.io.*;public class BirdProgram{	public static void main(String[] args) throws IOException	{		try{			BufferedReader br = new BufferedReader(new FileReader("birds.txt"));			String input = br.readLine();			Boolean find;			BirdNode newNode = new BirdNode(input);			BirdLinkedList list = new BirdLinkedList(newNode);					while(input != null)			{				find = list.find(newNode);								if (find == false)				{					list.insertFront(newNode);				}							input = br.readLine();						}					System.out.println("This is the original list: ");			System.out.println();			list.print();					BirdLinkedList sort = new BirdLinkedList(newNode);					list.ref = list.head;			list.highest = list.head;					while(list.ref != null)			{				list.ref2 = list.head;				list.highest = list.head;				while(list.ref2 != null)				{					if(list.ref2.count > list.highest.count)					{						list.highest = list.ref2;					}					list.ref2 = list.ref2.next;				}				sort.insertFront(list.highest);				list.remove(list.highest);				list.ref = list.head;			}				System.out.println();			System.out.println("Sorted List: ");			System.out.println();			sort.print();			br.close();			BufferedReader br2 = new BufferedReader(new FileReader("birds2.txt"));			input = br2.readLine();					while(input != null)			{				sort.remove(newNode);				input = br2.readLine();			}						System.out.println();			System.out.println("Sorted list without rejected birds: ");			System.out.println();			sort.print();		}		catch(IOException e)		{			System.out.println(e.getMessage());		}	}}