Hahah your right im just so stressed one little bug has been bothering me all week. Anyway after fiddling around for the 426th time I actually got rid of the error.
private TeamData FindTeam(String teamName) {
//
This is what FindTeam is suppose to find, the teams in the text file. If the team is already contained in the arraylist, then just update it but if the team hasnt been added to the arraylist, then return a null here is a sample
test file.
But as you can see, there is noreunnerup team for the Cornel, so I am getting a nullsuchelement exception. So I figure if I make a statement, that if the tokenizer is a null, it should just skip it, and continue to read the next one. So I did, and it doesnt read the null after Cornel, BUT! Northwestern played itself and my catch statement catches it, but I get an error when I try to sort the teams using collections.sort
NCAA Men's Basketball Tournament Archive
Please enter the tournament data file.. eg ncaa-test.data, ncaa2001.data, etc.
ncaa-test.data.txt
File format error14
1944:Cornell
Error: Northwestern couldn't have played itself19
1990:Northwestern:Northwestern
Exception in
thread "main" java.lang.ClassCastException: java.lang.String
at TournamentArchive$CompareTeamsByName.compare(TournamentArchive.java:1
60)
at java.util.Arrays.mergeSort(Arrays.java:1241)
at java.util.Arrays.mergeSort(Arrays.java:1248)
at java.util.Arrays.mergeSort(Arrays.java:1248)
at java.util.Arrays.sort(Arrays.java:1188)
at java.util.Collections.sort(Collections.java:153)
at TournamentArchive.SortTeamList(TournamentArchive.java:205)
at TournamentArchive.main(TournamentArchive.java:324)
Press any key to continue...
[ October 11, 2002: Message edited by: Dirk Schreckmann ]