Project

General

Profile

« Previous | Next » 

Revision a1171a3c

Added by Patrick Plitzner over 4 years ago

ref #8313 Adapt display converter to Collection display value

View differences:

eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/descriptiveDataSet/matrix/MatrixUtility.java
9 9
package eu.etaxonomy.taxeditor.editor.descriptiveDataSet.matrix;
10 10

  
11 11
import java.util.Set;
12
import java.util.stream.Collectors;
13 12

  
14 13
import org.eclipse.swt.graphics.Image;
15 14

  
......
17 16
import eu.etaxonomy.cdm.model.description.DescriptionType;
18 17
import eu.etaxonomy.cdm.model.description.DescriptiveDataSet;
19 18
import eu.etaxonomy.cdm.model.description.Feature;
20
import eu.etaxonomy.cdm.model.description.QuantitativeData;
21
import eu.etaxonomy.cdm.model.description.StatisticalMeasure;
22 19
import eu.etaxonomy.cdm.model.taxon.Classification;
23 20
import eu.etaxonomy.cdm.model.taxon.TaxonNode;
24 21
import eu.etaxonomy.taxeditor.model.ImageResources;
......
40 37
        return feature.getLabel();
41 38
    }
42 39

  
43
    /**
44
     * Returns a string representation for the given {@link QuantitativeData}
45
     * @param data the quantitative data
46
     * @return a string representation of the data
47
     */
48
    public static String getQuantitativeLabel(QuantitativeData data) {
49
        String label = "";
50
        Float min = data.getMin();
51
        Float max = data.getMax();
52
        if(min!=null||max!=null){
53
            label += "["+(min!=null?min.toString():"?")+"-"+(max!=null?max.toString():"?")+"] ";
54
        }
55
        label += data.getStatisticalValues().stream().
56
        filter(value->value.getType().equals(StatisticalMeasure.EXACT_VALUE()))
57
        .map(exact->Float.toString(exact.getValue()))
58
        .collect(Collectors.joining(", "));
59

  
60
        return label;
61
    }
62

  
63 40
    /**
64 41
     * Returns a string representation for the given min/max values
65 42
     * @param minTotal the min value

Also available in: Unified diff