(no commit message)
[cdmlib.git] / cdmlib-services / src / main / java / eu / etaxonomy / cdm / api / service / statistics / StatisticsConfigurator.java
1 // $Id$
2 /**
3 * Copyright (C) 2009 EDIT
4 * European Distributed Institute of Taxonomy
5 * http://www.e-taxonomy.eu
6 *
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.
9 */
10 package eu.etaxonomy.cdm.api.service.statistics;
11
12 import java.util.ArrayList;
13 import java.util.Collections;
14 import java.util.List;
15
16 import eu.etaxonomy.cdm.model.common.IdentifiableEntity;
17
18 /**
19 * This class configures the statistical request to
20 * a CDM Store. It defines which statistical values should
21 * be computed and returned.
22 *
23 * on a CDM Store
24 * @author a.mueller
25 * @date 21.09.2012
26 *
27 */
28 public class StatisticsConfigurator {
29
30 public static StatisticsConfigurator NewDefaultAllConfigurator(){
31 StatisticsConfigurator result = new StatisticsConfigurator();
32 result.addPart(StatisticsPartEnum.ALL);
33 return result;
34 }
35
36 //
37 private List<IdentifiableEntity> filter = new ArrayList<IdentifiableEntity>();
38 private List<StatisticsPartEnum> partList;
39
40
41 // *************************** METHODS ******************************/
42
43 public void addPart(StatisticsPartEnum part) {
44 this.partList.add(part);
45 }
46
47 public void addPart(int index, StatisticsPartEnum part) {
48 this.partList.add(index, part);
49 }
50
51 public List<StatisticsPartEnum> getPartList() {
52 return Collections.unmodifiableList(partList);
53 }
54
55
56 public List<IdentifiableEntity> getFilter() {
57 return filter;
58 }
59
60 public void addFilter(IdentifiableEntity filterItem) {
61 this.filter.add(filterItem);
62 }
63
64
65
66
67
68 }