views:

76

answers:

1
A: 

First: You should use List, not Collection, because the iteration order of Collection is not guaranteed.

Second: I prefer something like Option D, but instead of a two-element array, I'd suggest some sort of a genericized Pair class.

Hank Gay
It's ordered by date, so a SortedSet fits better. Lists should only be used when index based access is required. Set semantic usually fits better imo.
Willi
I have no beef with `Set`, but it's a bummer that `TreeSet` isn't as speedy as `ArrayList`; if you can get away with building the `List` in the order you need it, the tradeoff can be worth it in a tight loop. To be fair, it's probably not in this case, though.
Hank Gay