I don't think I understand the subject topics very well. I have a TreeMap that seems to work for storing a retrieving data. The value is a Drill object, and the key is a
String of the object. I have a bunch of
junit tests that seem to indicate it works. The show method in the code produces the right number of output lines. I know I don't understand it; I just copied an example from somewhere. The method isRealDrill is a copy of the show method that tries to look at each at each Drill in the map. When I run the tests for isRealDrill,
they all fail at the line with the cast to Drill, from the object that is returned by the Iterator. What exactly is returned. the key, the value, both (in what format?), or what? Before anyone mentions it, I know I can solve the problem faster using the getDrill method. But why does the cast not work? I think the same problem will show up when I try to make the show method produce prettier output.
The problem is line 29. Ignore line 30, a leftover from a failed effort.
Thanks.