View Javadoc
1   /*
2   * Licensed to the Apache Software Foundation (ASF) under one   *
3   * or more contributor license agreements.  See the NOTICE file *
4   * distributed with this work for additional information        *
5   * regarding copyright ownership.  The ASF licenses this file   *
6   * to you under the Apache License, Version 2.0 (the            *
7   * "License"); you may not use this file except in compliance   *
8   * with the License.  You may obtain a copy of the License at   *
9   *                                                              *
10  *   http://www.apache.org/licenses/LICENSE-2.0                 *
11  *                                                              *
12  * Unless required by applicable law or agreed to in writing,   *
13  * software distributed under the License is distributed on an  *
14  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
15  * KIND, either express or implied.  See the License for the    *
16  * specific language governing permissions and limitations      *
17  * under the License.                                           *
18  */
19  
20  package org.apache.rat.report.claim;
21  
22  import java.util.Map;
23  
24  
25  /**
26   * This class provides a numerical overview about
27   * the report.
28   */
29  public class ClaimStatistic {
30      private Map<String, Integer> documentCategoryMap, licenseFamilyCodeMap, licenseFamilyNameMap;
31      private int numApproved, numUnApproved, numGenerated, numUnknown;
32  
33      /**
34       * @return Returns the number of files with approved licenses.
35       */
36      public int getNumApproved() {
37          return numApproved;
38      }
39  
40      /**
41       * Sets the number of files with approved licenses.
42       * @param pNumApproved number of files with approved licenses.
43       */
44      public void setNumApproved(int pNumApproved) {
45          numApproved = pNumApproved;
46      }
47  
48      /**
49       * @return Returns the number of files with unapproved licenses.
50       * <em>Note:</em> This might include files with unknown
51       * licenses.
52       * @see #getNumUnknown()
53       */
54      public int getNumUnApproved() {
55          return numUnApproved;
56      }
57  
58      /**
59       * Sets the number of files with unapproved licenses.
60       * @param pNumUnApproved number of files with unapproved licenses.
61       */
62      public void setNumUnApproved(int pNumUnApproved) {
63          numUnApproved = pNumUnApproved;
64      }
65  
66      /**
67       * @return Returns the number of generated files.
68       */
69      public int getNumGenerated() {
70          return numGenerated;
71      }
72  
73      /**
74       * Sets the number of generated files.
75       * @param pNumGenerated the number of generated files.
76       */
77      public void setNumGenerated(int pNumGenerated) {
78          numGenerated = pNumGenerated;
79      }
80  
81      /**
82       * @return Returns the number of files, which are neither
83       * generated nor have a known license header.
84       */
85      public int getNumUnknown() {
86          return numUnknown;
87      }
88  
89      /**
90       * Sets the number of files, which are neither
91       * generated nor have a known license header.
92       * @param pNumUnknown set number of files. 
93       */
94      public void setNumUnknown(int pNumUnknown) {
95          numUnknown = pNumUnknown;
96      }
97  
98      /**
99       * Sets a map with the file types. The map keys
100      * are file type names and the map values
101      * are integers with the number of resources matching
102      * the file type.
103      * @param pDocumentCategoryMap doc-category map.
104      */
105     public void setDocumentCategoryMap(Map<String, Integer> pDocumentCategoryMap) {
106         documentCategoryMap = pDocumentCategoryMap;
107     }
108 
109     /**
110      * @return Returns a map with the file types. The map keys
111      * are file type names and the map values
112      * are integers with the number of resources matching
113      * the file type.
114      */
115     public Map<String, Integer> getDocumentCategoryMap() {
116         return documentCategoryMap;
117     }
118 
119     /**
120      * @return Returns a map with the license family codes. The map
121      * keys are license family category names,
122      * the map values are integers with the number of resources
123      * matching the license family code.
124      */
125     public Map<String, Integer> getLicenseFileCodeMap() {
126         return licenseFamilyCodeMap;
127     }
128 
129     /**
130      * Sets a map with the license family codes. The map
131      * keys are instances of license family category names and
132      * the map values are integers with the number of resources
133      * matching the license family code.
134      * @param pLicenseFamilyCodeMap license family map.
135      */
136     public void setLicenseFileCodeMap(Map<String, Integer> pLicenseFamilyCodeMap) {
137         licenseFamilyCodeMap = pLicenseFamilyCodeMap;
138     }
139 
140     /**
141      * @return Returns a map with the license family codes. The map
142      * keys are the names of the license families and
143      * the map values are integers with the number of resources
144      * matching the license family name.
145      */
146     public Map<String, Integer> getLicenseFileNameMap() {
147         return licenseFamilyNameMap;
148     }
149 
150     /**
151      * Sets map with the license family codes. The map
152      * keys are the name of the license families and
153      * the map values are integers with the number of resources
154      * matching the license family name.
155      * @param pLicenseFamilyNameMap license family-name map.
156      */
157     public void setLicenseFileNameMap(Map<String, Integer> pLicenseFamilyNameMap) {
158         licenseFamilyNameMap = pLicenseFamilyNameMap;
159     }
160 }