in there any particular reason why a type check for a class instead of an
interface is performed?
For example in ContinuousPortrayal2D in the method hitOrDraw at line 234 for
the class SimplePortrayal2D is checked to avoid a runtime error.
Is there any reason to use instead of a class for example the Portrayal2D
interface that defines basically the same methods (some are missing but I think
they can easily be added without any major changes in code and logic of
The reason behind my question is more flexibility running 2D and 3D
simulations. Type checking for a class requires that the given object inherits
from the superclass (in this case SimplePortrayal2D) and hence Java does not
support multiple sub-classing you have to write for different classes identical
code if you're not (don't like to or cannot) inherit from SimplePortrayal2D.
Thanks for your help,