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