1 package fr.ifremer.tutti.service.export.pdf;
2
3 /*
4 * #%L
5 * Tutti :: Service
6 * %%
7 * Copyright (C) 2012 - 2014 Ifremer
8 * %%
9 * This program is free software: you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as
11 * published by the Free Software Foundation, either version 3 of the
12 * License, or (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public
20 * License along with this program. If not, see
21 * <http://www.gnu.org/licenses/gpl-3.0.html>.
22 * #L%
23 */
24
25 import fr.ifremer.tutti.service.export.ExportBatchEntry;
26
27 /**
28 * To store a species or batch entry within his speices informations,
29 * his sorted weight, total weight and percentage amoong the total catch
30 * weight.
31 *
32 * @since 3.0-rc-1
33 */
34 public class PdfExportBatchEntry extends ExportBatchEntry {
35
36 protected final String code;
37
38 protected final String scientificName;
39
40 protected final String vernacularCode;
41
42 protected float percentage;
43
44 public PdfExportBatchEntry(String code,
45 String scientificName,
46 String vernacularCode,
47 float sortedWeight, float totalWeight,
48 float catchTotalWeight) {
49 super(null);
50
51 this.code = code;
52 this.scientificName = scientificName;
53 this.vernacularCode = vernacularCode;
54
55 addSortedWeight(sortedWeight);
56 addTotalWeight(totalWeight);
57 this.percentage = 100 * totalWeight / catchTotalWeight;
58 }
59
60 public String getCode() {
61 return code;
62 }
63
64 public String getScientificName() {
65 return scientificName;
66 }
67
68 public String getVernacularCode() {
69 return vernacularCode;
70 }
71
72 public float getPercentage() {
73 return percentage;
74 }
75 }