[Biojava-dev] List vs LinkedHashMap
Richard Holland
holland at eaglegenomics.com
Fri Feb 19 19:51:13 UTC 2010
Depends on whether or not you want to parse-at-once or stream-parse. If the parser is set up to load the whole lot at once, then a map is fine, otherwise not.
On 20 Feb 2010, at 08: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
--
Richard Holland, BSc MBCS
Operations and Delivery Director, Eagle Genomics Ltd
T: +44 (0)1223 654481 ext 3 | E: holland at eaglegenomics.com
http://www.eaglegenomics.com/
More information about the biojava-dev
mailing list