/** TODO: Synchronize once per read, not once per varlet */
private void addVar(Varlet v){
			long key=key(v.chromosome, v.beginLoc);
			ArrayList<Varlet> list=keymap.get(key);
			assert(list!=null) : "\nCan't find "+key+" in "+keymap.keySet()+"\n";
			synchronized(list){
				list.add(v);
				if(list.size()>=WRITE_BUFFER){
					if(MERGE_EQUAL_VARLETS){
						mergeEqualVarlets(list);
					}else{
						Collections.sort(list);
					}
					writeList(list);
					list.clear();
				}
			}
		}
private void addVar(Varlet v){
long key=key(v.chromosome, v.beginLoc);
ArrayList<Varlet> list=keymap.get(key);
assert(list!=null) : "\nCan't find "+key+" in "+keymap.keySet()+"\n";
synchronized(list){
list.add(v);
if(list.size()>=WRITE_BUFFER){
if(MERGE_EQUAL_VARLETS){
mergeEqualVarlets(list);
}else{
Collections.sort(list);
}
writeList(list);
list.clear();
}
}
}
private void addVar(Varlet v){
long key=key(v.chromosome, v.beginLoc);
ArrayList<Varlet> list=keymap.get(key);
assert(list!=null) : "\nCan't find "+key+" in "+keymap.keySet()+"\n";
synchronized(list){
list.add(v);
if(list.size()>=WRITE_BUFFER){
if(MERGE_EQUAL_VARLETS){
mergeEqualVarlets(list);
}else{
Collections.sort(list);
}
writeList(list);
list.clear();
}
}
}
private void addVar(Varlet v){
long key=key(v.chromosome, v.beginLoc);
ArrayList<Varlet> list=keymap.get(key);
assert(list!=null) : "\nCan't find "+key+" in "+keymap.keySet()+"\n";
synchronized(list){
list.add(v);
if(list.size()>=WRITE_BUFFER){
if(MERGE_EQUAL_VARLETS){
mergeEqualVarlets(list);
}else{
Collections.sort(list);
}
writeList(list);
list.clear();
}
}
}