swarm-support
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Probes in Java (subclass)


From: Marie-Edith Bissey
Subject: Re: Probes in Java (subclass)
Date: Thu, 28 Jun 2001 14:17:09 +0200 (MEST)

On 27 Jun 2001, Marcus G. Daniels wrote:

|>>>>> "MEB" == Marie-Edith Bissey <address@hidden> writes:
|
|MEB> I cannot probe the IntelligentPlayer for the variables declared
|MEB> only in Player (as public variables) and which are common to the
|MEB> two types of players. 
|
|Try something like this:
|
|        VarProbe probeVariable (String name)
|        {
|            VarProbe varProbe = null;
|            Class baseClass = getProbedClass ();
|
|            do {
|                varProbe =
|                    Globals.env.probeLibrary.getProbeForVariable$inClass
|                    (name, baseClass);
|                baseClass = baseClass.getSuperclass ();
|            } while (varProbe == null && baseClass != null);
|            return varProbe;
|        }
|

Thanks, I got it to work!
The only thing I had to change was to replace the line:
Class baseClass = getProbedClass ();
by the following:
Class baseClass =probeName.getProbedClass ();
where probeName is the name I gave to the probe and was inherited from
the superclass.

Marie-Edith.

__________________________________________________________________

Marie-Edith Bissey
Universita` del Piemonte Orientale "Amedeo Avogadro"
Facolta` di Science Politiche         email: address@hidden
Corso Borsalino 50                    tel: +39-0131-283700
15 100 Alessandria -- ITALIA          fax: +39-0131-263030
http://polis.unipmn.it/doc/bis/hp.htm


                  ==================================
   Swarm-Support is for discussion of the technical details of the day
   to day usage of Swarm.  For list administration needs (esp.
   [un]subscribing), please send a message to <address@hidden>
   with "help" in the body of the message.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]