1
|
/**
|
2
|
* Copyright (C) 2018 EDIT
|
3
|
* European Distributed Institute of Taxonomy
|
4
|
* http://www.e-taxonomy.eu
|
5
|
*
|
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.
|
8
|
*/
|
9
|
package eu.etaxonomy.taxeditor.editor.workingSet.matrix;
|
10
|
|
11
|
import eu.etaxonomy.cdm.model.description.Feature;
|
12
|
import eu.etaxonomy.cdm.model.description.QuantitativeData;
|
13
|
|
14
|
/**
|
15
|
* Utility class for the character matrix editor
|
16
|
* @author pplitzner
|
17
|
* @since Jan 4, 2018
|
18
|
*
|
19
|
*/
|
20
|
public class MatrixUtility {
|
21
|
|
22
|
/**
|
23
|
* Returns the column property string for the given {@link Feature}
|
24
|
* @param feature
|
25
|
* @return
|
26
|
*/
|
27
|
public static String getProperty(Feature feature){
|
28
|
return feature.getLabel();
|
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.getMin();
|
38
|
Float max = data.getMax();
|
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
|
}
|
53
|
}
|
54
|
|