| |||
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] |
Dmitry Markman <email@hidden> wrote:
public class AlignCommand extends AbstractCommand {
public static abstract class Alignment {
public final static Alignment LEFTS = new Alignment("Lefts") {
public void moveBy(Figure f, Rectangle anchor) {
Rectangle rr = f.displayBox();
f.moveBy(anchor.x-rr.x, 0);
}
};
private Alignment(String newDescription) {
...
}
public abstract void moveBy(Figure f, Rectangle anchor);
}
}
I think the way to avoid the problem is to not declare Alignment as abstract, and to define Alignment.moveBy() as an empty method by default, with an override in each anonymous subclass.
Since all the possible definitions of Alignment's subclasses are entirely under your control in exactly one source file, I don't see how you're gaining anything by declaring it abstract.
I still think it would be worthwhile to run 'javap' on the output of 'javac', to discover what it's doing about the private constructor. I suspect it's being promoted to the package-visibility
| References: | |
| >Re: problem with compiling abstract class with CW (MAC OS X) (From: Greg Guerin <email@hidden>) |
| Home | Archives | FAQ | Terms/Conditions | Contact | RSS | Lists | About |
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE
Contact Apple | Terms of Use | Privacy Policy
Copyright © 2007 Apple Inc. All rights reserved.