Neither BufferedImage nor Rectangle2D are interfaces, and Java has no multiple inheritance of classes, so you're not going to get that.
What you can do is create a wrapper class (and maybe an interface to sit on top of it) that encapsulates instances of both and synchronises data between them.
Of course you might get into trouble trying to use instances of that class with other classes that expect one or the other explicitly (rather than through their implemented interfaces, which you could have your class implement as well).
Yes, I know that one may directly use composition and have two fields, one each for BufferedImage and Rectangle2D, using the latter's intersect
method to check ahead for acceptable moving before updating the particular Rasters involved et al for the screen.
I do know that you can write an interface which contains actionable code, from one internally supplied abstract class.
I want to write that internal class to extend Rectangle2D to go with an outer interface; in theory so that I now have an interface
type which has the very Rectangle2D actionable code inside, so I have implement off that method and use setData(raster) to have my desired
mutable object IMPLEMENT off of a previous class (non interface) type.
Help with this end?
-Why will the following not compile on my java 1.6?
If you try to compile it the compiler will give you a message that actually TELLS you why it won't compile.
Then if you post the actual compiler output EVERYONE will know why it won't compile.
abstract class Rectangle2DImplementation extends Rectangle2D
So you want to define an intertace that contains an abstract class that implements the interface you are defining that hasn't been defined yet?
Does that make sense to you to try to define something that depends on it already being defined?
You can always turn a class into a functional interface using composition,
of the abstract class:
abstract class InnerRectangle2D implements SubRectangle2D
private static Rectangle2D.Double RECTANGLE = new Rectangle2D.Double();
private static String fred = new String("data");
public static void add(double x, double y)
None of what you said addresses ANY of the comments that I made.
Reread my entire reply and address what I said.