Project

General

Profile

« Previous | Next » 

Revision 35ba1a56

Added by Patrick Plitzner about 6 years ago

ref #7095 Format enhancement for quantitative data

  • unit shown in abbreviation
  • min/max shown as range

View differences:

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

  
11 11
import eu.etaxonomy.cdm.model.description.Feature;
12
import eu.etaxonomy.cdm.model.description.QuantitativeData;
12 13

  
13 14
/**
14 15
 * Utility class for the character matrix editor
......
26 27
    public static String getProperty(Feature feature){
27 28
        return feature.getLabel();
28 29
    }
30

  
31
    /**
32
     * Returns a string representation for the given {@link QuantitativeData}
33
     * @param data the quantitative data
34
     * @return a string representation of the data
35
     */
36
    public static String getQuantitativeLabel(QuantitativeData data) {
37
        Float min = data.getMax();
38
        Float max = data.getMin();
39
        return getQuantitativeLabel(min, max);
40
    }
41

  
42
    /**
43
     * Returns a string representation for the given min/max values
44
     * @param minTotal the min value
45
     * @param maxTotal the max value
46
     * @return a string representation of the data
47
     */
48
    public static String getQuantitativeLabel(Float min, Float max) {
49
        return (min==null?"?":min.toString())
50
                +" - "
51
                +(max==null?"?":max.toString());
52
    }
29 53
}
54

  

Also available in: Unified diff