5a25d8c5ddde6227088d0c50dffc4e693d4fa7d3
2 * Copyright (C) 2018 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
.taxeditor
.editor
.descriptiveDataSet
.matrix
;
11 import java
.util
.HashMap
;
14 import eu
.etaxonomy
.cdm
.model
.description
.Feature
;
15 import eu
.etaxonomy
.cdm
.model
.description
.State
;
22 public class CategoricalDataHistogram
{
24 private Feature feature
;
25 private Map
<State
, Integer
> stateCountMap
;
27 public CategoricalDataHistogram(Feature feature
) {
28 this.feature
= feature
;
29 this.stateCountMap
= new HashMap
<>();
30 feature
.getSupportedCategoricalEnumerations()
31 .forEach(voc
->voc
.getTerms()
32 .forEach(state
->stateCountMap
.put(state
, 0)));
35 public void addState(State state
){
36 Integer integer
= stateCountMap
.get(state
);
37 stateCountMap
.put(state
, integer
+1);
40 public Map
<State
, Integer
> getStateCountMap() {
44 public Feature
getFeature() {