posted 19 years ago
I would agree that your best bet is to write a class called "StationList" which has a List encapsulated inside of it. Then write a few accessor methods like setStation, getStation, size, addStation and maybe removeStation. These could all operate on a class called "Station" which has whatever properties you want a station to have....
I tend to do this with most custom list applications, and I like it because you are writing the list accessor methods yourself, so you can control what goes in and what goes out. A BIG plug here is that you do the casting to Object inside these accessor methods, so all the "client" programmer sees is Station's going in and out.
You can also do things like check for null, so that null references cannot be added to the list.
Hope that helps.