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 // private Map<StatisticsTypeEnum, Number> countMap;
36 // private Map<StatisticsPartEnum, Map<IdentifiableEntity, Statistics>>
39 private List
<IdentifiableEntity
> about
;
41 // it's a pitty, but for JSON Map keys must be Strings
42 // see also: JSONObject _fromMap( Map map, JsonConfig jsonConfig )
43 // --> TODO: modify MapJSONValueProcessor.processArrayValue(Object value,
44 // JsonConfig jsonConfig)???
46 private Map
<String
, Number
> countMap
;
48 public Statistics(StatisticsConfigurator configurator
) {
49 this.request
= configurator
;
50 this.countMap
= new HashMap
<String
, Number
>();
52 this.about
= new ArrayList
<IdentifiableEntity
>();
55 public void setRequest(StatisticsConfigurator request
) {
56 this.request
= request
;
59 public StatisticsConfigurator
getRequest() {
63 public Map
<String
, Number
> getCountMap() {
67 public void addCount(StatisticsTypeEnum type
, Integer number
) {
68 this.countMap
.put(type
.getLabel(), number
);
71 // public Map<StatisticsPartEnum, Map<IdentifiableEntity, Statistics>>