I working on an application as an hobby project. It is written in Java and part of a system to calculate decompression scheme for scuba diving. The problem I have is in the class that stores my diveplan, well it is not realy a problem since it works fine but I got the feeling it can be designed better so i would like to ask for some feedback.
What I got now is the following.
A class DivePlan which has an ArrayList of DiveOpperations (ArrayList<DiveOpperation>).
The DivePlan class has 3 functions. One to plan a descent, one to plan an ascent and one to plan a flat dive on the same depth. All these functions add a DiveOpperation object to the ArrayList. However ascents and descents have some other attributes as a dive that stays on the same depth. For example the speed in m/s of the ascent/descent. I set it to a speed of 0 for flat dives for now but that doesn't feel right. I'm aware I should make separate classes that extends the DiveOpperation but that way I don't know if it is an ascent, descent or flatdive class when I get it out of the array.
What would be a good design for such functionality?