jython/java inheritance question?

Matt Newcomb spock at telerama.com
Wed Oct 29 06:49:08 EST 2003


G'day,

Hi, I've got a java class called ChannelIteratorAlgorithm which
extends SampledChannelGroupIteratorAlgorithm. 
SampledChannelGroupIteratorAlgorithm has a stub method
processSampledChannelGroup(Object[] in, Object[] out) that is
overridden by a method in the ChannelIteratorAlgorithm class.

Now, I've got a jython script that contains a class that extends the
ChannelIteratorAlgorithm class ( are you having fun yet? ) and it's
got a processSampledChannelGroup method that looks like this:

class testalg(ChannelIteratorAlgorithm):
    def processSampledChannelGroup(self, inGroups, outGroups):
        if (self.samplesToPass!=0):
            print "samples left: %d" % self.samplesToPass
            ChannelIteratorAlgorithm.processSampledChannelGroup(self,
inGroups,
outGroups)

However, each time I try to run this script I get this exception:

2003-10-29 05:26:29 ERROR:: spigot_1.handleData() encountered a fatal
Exception:Traceback (innermost last):
  File "<string>", line 187, in processSampledChannelGroup
AttributeError: class
'gov.nasa.gsfc.irc.algorithms.ChannelIteratorAlgorithm' has no
attribute 'processSampledChannelGroup'

What?!?!?!  Why an attribute and not a method?  And why, given that
yes there is an implementation of processSampledChannelGroup in the
ChannelIteratorAlgorithm class and yes it really looks like:

	protected void processSampledChannelGroup
		(Object[] inputChannelDataBuffersForGroup, 
		Object[]  outputChannelDataBuffersForGroup)

would there be an issue?

Is this a feature that I'm unaware of?

Thanks for any suggestions,

Matt Newcomb
Yerkes Observatory
Williams Bay, WI 53191




More information about the Python-list mailing list