My question is, do folks generally use the subcontractor name as a primary key? I've chosen not to do this (you might have subcontractors with the same name in different locations), and I use the record's position in the file (ie. its number) as the primary key.
Problem is, my interface demands this method:
Seeing as I don't pass the primary key into the String  data array above, (my record is assigned a key by its location in the file) how can I check for a DuplicateKeyException? It's pretty much impossible to get duplicate keys the way I'm doing things.
Perhaps I should interpret this as "Duplicate Record"?
If so, what's the best way to check for dupes? I would assume it's to keep an array of the hashes of each record and check against that, rather than digging through the database file.
I don't use that exception. I mentioned in my choices.txt file that this exception cannot be thrown because I also use the record position as primary key. I placed the exception in my methods so it is available for future enhancements, but it is never thrown.
I saw the same problem but have ignored it since I am working on other areas. from my impression, you can't change the interface that was provided by the assignment, I don't think you can remove the throw from the interface.