1 package compbio.stat.servlet.util;
\r
3 import java.util.Date;
\r
4 import java.util.Map;
\r
6 import compbio.stat.collector.StatProcessor;
\r
7 import compbio.ws.client.Services;
\r
9 public class Totals {
\r
16 public int getTotal() {
\r
20 public int getIncomplete() {
\r
24 public int getAbandoned() {
\r
28 public int getCancelled() {
\r
32 public int getFailed() {
\r
36 public static Totals sumOfTotals(Map<Date, Totals> stat) {
\r
37 Totals total = new Totals();
\r
38 for (Map.Entry<Date, Totals> entry : stat.entrySet()) {
\r
39 Totals mtotal = entry.getValue();
\r
40 total.total += mtotal.getTotal();
\r
41 total.incomplete += mtotal.getIncomplete();
\r
42 total.abandoned += mtotal.getAbandoned();
\r
43 total.cancelled += mtotal.getCancelled();
\r
44 total.failed += mtotal.getFailed();
\r
49 public static Totals sumStats(Map<Services, StatProcessor> stat) {
\r
50 Totals total = new Totals();
\r
51 for (Map.Entry<Services, StatProcessor> serv : stat.entrySet()) {
\r
52 total.total += serv.getValue().getJobNumber();
\r
53 total.incomplete += serv.getValue().getIncompleteJobs().size();
\r
54 total.abandoned += serv.getValue().getAbandonedJobs().size();
\r
55 total.cancelled += serv.getValue().getCancelledJobs().size();
\r
56 total.failed += serv.getValue().getFailedJobs().size();
\r