Maybe have the equals function be the most strict ie require everything
to be equal but then provide different methods (or versions of equals()
with arguments) that can be used to test for less stringent equality.

Eg you could have equals() and equals(boolean ignoreAnnotation) etc

Remember overiding the default equals() means sticking to the equals()
contract in the Java spec and also requires overiding the hashcode()
method otherwise the Collections classes will behave strangely.

Mark

> -----Original Message-----
> From: David Huen [mailto:[EMAIL PROTECTED]] 
> Sent: Thursday, 4 April 2002 9:17 a.m.
> To: [EMAIL PROTECTED]
> 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  -  [EMAIL PROTECTED] 
> http://biojava.org/mailman/listinfo/biojava-l
> 
=======================================================================
Attention: The information contained in this message and/or attachments
from AgResearch Limited is intended only for the persons or entities
to which it is addressed and may contain confidential and/or privileged
material. Any review, retransmission, dissemination or other use of, or
taking of any action in reliance upon, this information by persons or
entities other than the intended recipients is prohibited by AgResearch
Limited. If you have received this message in error, please notify the
sender immediately.
=======================================================================
_______________________________________________
Biojava-l mailing list  -  [EMAIL PROTECTED]
http://biojava.org/mailman/listinfo/biojava-l

Reply via email to