Login  Register

Re: inheritance

Posted by Tony Shepherd on Aug 08, 2006; 10:57pm
URL: http://imagej.273.s1.nabble.com/inheritance-tp3701842p3701843.html

Thanks for the advice but I'm missing something crucial here! you wrote:

".. I question why you need to subclass ImageProcessor at all. The
subclasses of ImageProcessor are mainly for different bit depths. Do you
need a new, crazy kind of bit depth?.."

I thought that if I wanted to write a method to do ANYTHING to an
ImageProgessor object (like filter it, classify it or anything, not just
fiddle with bit depths) then these methods had to be added on to the end of
the class that constructs the object. (i.e. by editing ImageProcessor.java
OR creating class MyImageType, which extends ImageProcessor)

It sounds like I was mistaken, but where else can I stick some fresh code,
so that I can execute the method by adding the line:

   myobject.dosomething();

to a plugin?

I tried sticking a fresh method class at the bottom of the plugin itself
(outside the main method) but it's not picked up.


Thanks vey much

Tony