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 documentCategoryMap, licenseFamilyCodeMap, licenseFamilyNameMap;
31      private int numApproved, numUnApproved, numGenerated, numUnknown;
32  
33      /**
34       * 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       */
43      public void setNumApproved(int pNumApproved) {
44          numApproved = pNumApproved;
45      }
46  
47      /**
48       * Returns the number of files with unapproved licenses.
49       * {@em Note:} This might include files with unknown
50       * licenses.
51       * @see #getNumUnknown()
52       */
53      public int getNumUnApproved() {
54          return numUnApproved;
55      }
56  
57      /**
58       * Returns the number of files with unapproved licenses.
59       * {@em Note:} This might include files with unknown
60       * licenses.
61       * @see #setNumUnknown(int)
62       */
63      public void setNumUnApproved(int pNumUnApproved) {
64          numUnApproved = pNumUnApproved;
65      }
66  
67      /**
68       * Returns the number of generated files.
69       */
70      public int getNumGenerated() {
71          return numGenerated;
72      }
73  
74      /**
75       * Returns the number of generated files.
76       */
77      public void setNumGenerated(int pNumGenerated) {
78          numGenerated = pNumGenerated;
79      }
80  
81      /**
82       * 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       */
93      public void setNumUnknown(int pNumUnknown) {
94          numUnknown = pNumUnknown;
95      }
96  
97      /**
98       * Sets a map with the file types. The map keys
99       * are file type names and the map values
100      * are integers with the number of resources matching
101      * the file type.
102      */
103     public void setDocumentCategoryMap(Map pDocumentCategoryMap) {
104         documentCategoryMap = pDocumentCategoryMap;
105     }
106 
107     /**
108      * Returns a map with the file types. The map keys
109      * are file type names and the map values
110      * are integers with the number of resources matching
111      * the file type.
112      */
113     public Map getDocumentCategoryMap() {
114         return documentCategoryMap;
115     }
116 
117     /**
118      * Returns a map with the license family codes. The map
119      * keys are license family category names,
120      * the map values are integers with the number of resources
121      * matching the license family code.
122      */
123     public Map getLicenseFileCodeMap() {
124         return licenseFamilyCodeMap;
125     }
126 
127     /**
128      * Sets a map with the license family codes. The map
129      * keys are instances of license family category names and
130      * the map values are integers with the number of resources
131      * matching the license family code.
132      */
133     public void setLicenseFileCodeMap(Map pLicenseFamilyCodeMap) {
134         licenseFamilyCodeMap = pLicenseFamilyCodeMap;
135     }
136 
137     /**
138      * Returns a map with the license family codes. The map
139      * keys are the names of the license families and
140      * the map values are integers with the number of resources
141      * matching the license family name.
142      */
143     public Map getLicenseFileNameMap() {
144         return licenseFamilyNameMap;
145     }
146 
147     /**
148      * Returns a map with the license family codes. The map
149      * keys are the name of the license families and
150      * the map values are integers with the number of resources
151      * matching the license family name.
152      */
153     public void setLicenseFileNameMap(Map pLicenseFamilyNameMap) {
154         licenseFamilyNameMap = pLicenseFamilyNameMap;
155     }
156 }