[Biojava-l] FeatureHolder.containsFeature()
Matthew Pocock
matthew_pocock@yahoo.co.uk
Thu, 4 Apr 2002 11:52:53 +0100
Hum,
I would be happy if equals and hashCode on feature worked by being
equivalent to delegating to the return value of makeTemplate - this includes
all info except the children and parent. Since features can access both
children and parents, you would potentialy get into a circular stack if you
took hashcodes or equals of all fields.
Are there cases where two "equivalent" feature instances wouldn't produce
the same templates? Are there any cases where two "non-equivalent" features
would produce the same template (baring parent/child issues)?
Matthew
----- Original Message -----
From: "David Huen" <smh1008@cus.cam.ac.uk>
To: <biojava-l@biojava.org>
Sent: Wednesday, April 03, 2002 10:17 PM
Subject: [Biojava-l] FeatureHolder.containsFeature()
> Hi,
> I'm going thru' the process of doing a Gadfly-to-BioJava bridge.
>
> What are the semantics of containsFeature() should have? In
> SimpleFeatureHolder.java, it goes for the objects being identical which
> makes sense for an in-memory implementation but much more problematic
> with a database-backed object.
>
> If containsFeature() should work on "equality" of object, when should
> objects be equal? When all fields are identical? Or when Location type
> (and strand if relevant) match? How do we deal with the annotation
> bundle? If it is required for equality how do we deem equality?
>
> Or do we attempt to circumvent all this by requiring that the feature has
> the same row id in its respective table as the feature being compared?
>
> Thanks,
> David Huen
>
> _______________________________________________
> Biojava-l mailing list - Biojava-l@biojava.org
> http://biojava.org/mailman/listinfo/biojava-l