/** 
 * A Driver to test SizableMatrix
 * 
 * @author Nancy Harris
 * @version Master 04/23/2013
 *
 */
public class FinalExam {
	
	public static void main (String args[])
	{
		Sizable[][] matrix = new Sizable[3][];
		matrix[0] = new Sizable[2];
		matrix[2] = new Sizable[3];
		
		matrix[0][0] = new AudioFile("Old MacDonald Had a Farm", 
				"unknown", "none", 9);
		matrix[0][1] = new SizableString("Isn't Java fun?");
		matrix[2][0] = new AudioFile("Baa Baa Black Sheep", 
				"Mother Goose", "Favorite Children's Rhymes", 99);
		matrix[2][2] = new AudioFile("100 Bottles of Mt Dew on the Wall",
				"unknown", null, 24);
		SizableMatrix sam = new SizableMatrix(matrix);
		
		// Run tests
		System.out.println("Average: " + sam.getAverageObjectSize());
		System.out.println("Total: " + sam.getTotalObjectSize());
		System.out.println("Smallest: " + sam.getSmallestObject());
		System.out.println("Largest: " + sam.getLargestObject());
		
		System.out.println("Row: " + sam.getLargestinRow(2));
		try
		{
			System.out.println("Row: " + sam.getLargestinRow(1));
		}
		catch(ArrayIndexOutOfBoundsException aioobe)
		{
			System.out.println("Correctly errored");
		}
		catch(Exception E)
		{
			System.out.println("Wrong error");
		}	
	}
}
