Lets say i have two classes A and B, which have theirs internal state represented by enum State. Class B extends A to add new functionality, but it also adds new internal state. To be precise, it adds fine-grained state support, by dividing one of the A`s state into two new states.
I also need to use PropertyChangeSupport to monitor state changes.
Currently I have all states defined in class A in enum State. I have protected methods setState() and getState(). To check on state from the outside, I wrote methods isAvaible(), isComplete(), etc. These methods are present only in appropriate class, depending on their hierarchy and state support.
I realy dont like the idea, having all states defined in parent class. How do I implement this correctly in Java? As far as I know, it`s not possible to use inheritance with enums.