Hi Mat,
this looks like it should make use of the Java 1.5 Generics.
Unfortunately the implementation would have to suffer and probably do
something nasty like RTTI behind the curtains, but it would clean up the
interface.
I'd have to refresh my memory how to do it exactly, but you can have a
look here:
http://java.sun.com/j2se/1.5/pdf/generics-tutorial.pdf
I think I can dig out some example somewhere.
Cheers,
Jan
Matthew John Charles wrote:
> Hello all. This is mildly related to the discussion in today's meeting.
>
> I think it would be good to have a general interface for energy
> calibration, so that reconstruction code can be decoupled from
> all the fiddly aspects of energy calibration code. I suggest two
> interfaces:
>
> org.lcsim.util.event.ParticleEnergyCalibration
> org.lcsim.util.event.ClusterEnergyCalibration
>
> which would look like:
>
> public interface ParticleEnergyCalibration {
> public double energy(ReconstructedParticle part);
> }
>
> public interface ClusterEnergyCalibration {
> public double energy(Cluster clus);
> }
>
> Thoughts?
>
>
> Cheers,
>
> Mat.
>
--
Jan F. Strube -- University of Oregon
Stanford Linear Accelerator Center
bldg. 48, rm. 244, MS 35
(650) 926-2913 phone
8522 fax
|