3 * Copyright (C) 2009 EDIT
4 * European Distributed Institute of Taxonomy
5 * http://www.e-taxonomy.eu
7 * The contents of this file are subject to the Mozilla Public License Version 1.1
8 * See LICENSE.TXT at the top of this package for the full license terms.
10 package eu
.etaxonomy
.cdm
.api
.service
.statistics
;
12 import java
.util
.ArrayList
;
13 import java
.util
.HashMap
;
14 import java
.util
.List
;
17 import eu
.etaxonomy
.cdm
.model
.common
.IdentifiableEntity
;
20 * This class is meant to hold the result of a statistical request to a CDM
21 * Store. It e.g. holds the information how many classifications, taxa, names,
22 * synonyms, references, etc. are stored in the store. This information may also
23 * be hold for certain parts of a store. E.g. may store the statistical
24 * information for each classification. This partitioninc is recursive so a
25 * partition is again represented by a {@link Statistics}.
27 * @author a.mueller, a.kohlbecker, s.buers
30 public class Statistics
{
32 private StatisticsConfigurator request
;
34 // it's a pitty, but for JSON Map keys must be Strings
35 // see also: JSONObject _fromMap( Map map, JsonConfig jsonConfig )
36 // --> TODO: modify MapJSONValueProcessor.processArrayValue(Object value,
37 // JsonConfig jsonConfig)???
39 private Map
<String
, Number
> countMap
;
41 public Statistics(StatisticsConfigurator configurator
) {
42 this.request
= configurator
;
43 this.countMap
= new HashMap
<String
, Number
>();
46 public void setRequest(StatisticsConfigurator request
) {
47 this.request
= request
;
50 public StatisticsConfigurator
getRequest() {
54 public Map
<String
, Number
> getCountMap() {
58 public void addCount(StatisticsTypeEnum type
, Long number
) {
59 this.countMap
.put(type
.getLabel(), number
);