[Biojava-l] equals() method for SymbolList
Matthew Pocock
matthew_pocock@yahoo.co.uk
Fri, 11 Oct 2002 15:27:37 +0100 (BST)
Hi Lachlan,
SymbolList should be behaving like a string over its
symbols. It is silly if it doesn't do this. Hash codes
should realy be calculated in a different (but
sequence-dependant) way to avoid scanning the whole of
very large sequences just to do a hash lookup. Anyone
got any ideas?
If you have some code to do this then we can fold it
back into the project.
Matthew
--- Lachlan Coin <lc1@sanger.ac.uk> wrote:
> Hi,
>
> I think this was raised a while back, but the
> equals() methods are not
> overridden in SymbolList classes, hence to compare
> equality you must do:
> sl1.toList().equals(sl2.toList()).
>
> I was just wondering if it were possible to change
> this, so that two
> SymbolLists are equal if they contain the same
> symbols in the same order.
> It would make hashing against SymbolList more
> convenient.
>
> Or is there a good way of getting around the problem
> of hashing against a
> SymbolList ? I guess one way is to put sl.toList()
> as the key, but then
> when you pull out the keys later you can't convert
> back into SymbolList
> easily.
>
> Thanks,
>
> Lachlan
>
> _______________________________________________
> Biojava-l mailing list - Biojava-l@biojava.org
> http://biojava.org/mailman/listinfo/biojava-l
__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com