File: AlignmentJob.java

package info (click to toggle)
bbmap 39.20%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 26,008 kB
  • sloc: java: 312,743; sh: 18,096; python: 5,247; ansic: 2,074; perl: 96; makefile: 39; xml: 38
file content (40 lines) | stat: -rwxr-xr-x 701 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package sketch;

import java.util.concurrent.ArrayBlockingQueue;

public class AlignmentJob {
	
	AlignmentJob(Comparison c_, ArrayBlockingQueue<Comparison> dest_){
		c=c_;
		dest=dest_;
	}
	
	void doWork(){
		assert(!isPoison());
		try {
			c.ssuIdentity();
		}catch (Throwable t){
			t.printStackTrace();
		}
		put();
	}
	
	private void put(){
		boolean success=false;
		while(!success){
			try {
				dest.put(c);
				success=true;
			} catch (InterruptedException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}
	}
	
	final boolean isPoison(){return c==null;}
	
	final Comparison c;
	final ArrayBlockingQueue<Comparison> dest;
	
}