[Biojava-dev] List vs LinkedHashMap
Andy Yates
ayates at ebi.ac.uk
Fri Feb 19 20:29:56 UTC 2010
Can't see any reason why not after all to get a collection back it's
just a case of calling values() on the Map. The only other things I
would say is I would prefer returning a Map rather than a
LinkedHashMap but if there's a good reason why you want to return the
solid class then that's fine :). I've done some work as well to
cleanup the generics situation in these which I hope are okay. If you
commit your changes in then I'll commit mine in & you can see what you
think.
Andy
On 19 Feb 2010, at 19:30, Scooter Willis wrote:
>
> I am starting to use the new FastaReader in a project and the
> default implementation I setup returns a List<ProteinSequence>. The
> very next thing I needed to do was convert to a
> LinkedHashMap<String,ProteinSequence> so I could query the sequence
> of interest. It would seem that this is probably a fairly standard
> use case. If I returned a LinkedHashMap<String,ProteinSequence> as
> the default container then we have a slight memory hit on keeping a
> hash of the accession ID and a linked list for preserving order.
>
> Does anyone have objections to returning the sequences read from a
> Fasta file as a LinkedHashMap?
>
> Thanks
>
> Scooter
> _______________________________________________
> biojava-dev mailing list
> biojava-dev at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/biojava-dev
--
Andrew Yates Ensembl Genomes Engineer
EMBL-EBI Tel: +44-(0)1223-492538
Wellcome Trust Genome Campus Fax: +44-(0)1223-494468
Cambridge CB10 1SD, UK http://www.ensemblgenomes.org/
More information about the biojava-dev
mailing list