[Biojava-dev] HashMap ==> LinkedHashMap in HashSequenceDB

Richard Holland holland at eaglegenomics.com
Mon Nov 16 18:13:24 UTC 2009


I've applied the patch to the trunk of biojava-live/core.

On 16 Nov 2009, at 14:53, Matias Piipari wrote:

> Hello
> 
> I'd like to propose a change to org.biojava.bio.seq.db.HashSequenceDB: swap
> the map implementation used to store the sequence-by-id map from HashMap to
> LinkedHashMap. This would allow iterating the sequences in a defined order
> (the order in which they were added to the map).
> 
> Best wishes
> Matias
> 
> 
> An example patch relative to rev 7059:
> 
> --- src/org/biojava/bio/seq/db/HashSequenceDB.java      (revision 7059)
> +++ src/org/biojava/bio/seq/db/HashSequenceDB.java      (working copy)
> @@ -22,8 +22,8 @@
> package org.biojava.bio.seq.db;
> 
> import java.io.Serializable;
> -import java.util.HashMap;
> import java.util.Iterator;
> +import java.util.LinkedHashMap;
> import java.util.Map;
> import java.util.Set;
> 
> @@ -203,6 +203,6 @@
>   public HashSequenceDB(org.biojava.bio.seq.db.IDMaker idMaker, String
> name) {
>     this.idMaker = idMaker;
>     this.name = name;
> -    this.sequenceByID = new HashMap();
> +    this.sequenceByID = new LinkedHashMap();
>   }
> }
> _______________________________________________
> 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