// create map
LinkedHashMap
// insert element into map
if( hashmapGene.containsKey(geneID) )
{
GeneInfo gene = hashmapGene.get(geneID);
gene.determineClass(tmp[3]);
}else
{
hashmapGene.put( geneID , new GeneInfo(chrom , st,end, promStartCoord, promEndCoord ,
tmp[3],tmp[4],strand ,tmp[6],tmp[7],tmp[8],tmp[9],tmp[10],tmp[11] ,
strLine ) );
}
// retrieve element from map
Set set = hashmapGene.entrySet();
System.out.println("Total Unique entry:" + set.size() ) ;
Iterator itr = set.iterator();
while(itr.hasNext()){
Map.Entry me = (Map.Entry) itr.next();
String id = (String)me.getKey();
GeneInfo geneObj = (GeneInfo) me.getValue();
}
Comments
Post a Comment