Clover icon

Coverage Report

  1. Project Clover database Thu Dec 4 2025 14:43:25 GMT
  2. Package jalview.ws2.helpers

File WSClientTaskWrapper.java

 

Coverage histogram

../../../img/srcFileCovDistChart0.png
60% of files have more coverage

Code metrics

0
7
5
1
52
35
5
0.71
1.4
5
1

Classes

Class Line # Actions
WSClientTaskWrapper 14 7 5
0.00%
 

Contributing tests

No tests hitting this source file were found.

Source view

1    package jalview.ws2.helpers;
2   
3    import jalview.gui.WebserviceInfo;
4    import jalview.ws.WSClientI;
5    import jalview.ws2.actions.api.TaskI;
6   
7    /**
8    * A simple wrapper around the {@link TaskI} implementing {@link WSClientI}. Its
9    * main purpose is to delegate the call to {@link #cancelJob} to the underlying
10    * task.
11    *
12    * @author mmwarowny
13    */
 
14    public class WSClientTaskWrapper implements WSClientI
15    {
16    private TaskI<?> delegate;
17   
18    private boolean cancellable;
19   
20    private boolean canMerge;
21   
 
22  0 toggle public WSClientTaskWrapper(TaskI<?> task, boolean cancellable, boolean canMerge)
23    {
24  0 this.delegate = task;
25  0 this.cancellable = cancellable;
26  0 this.canMerge = canMerge;
27    }
28   
 
29  0 toggle public WSClientTaskWrapper(TaskI<?> task)
30    {
31  0 this(task, true, false);
32    }
33   
 
34  0 toggle @Override
35    public boolean isCancellable()
36    {
37  0 return cancellable;
38    }
39   
 
40  0 toggle @Override
41    public boolean canMergeResults()
42    {
43  0 return canMerge;
44    }
45   
 
46  0 toggle @Override
47    public void cancelJob()
48    {
49  0 delegate.cancel();
50    }
51   
52    }