| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
package dr.evomodel.substmodel; |
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
public enum StratifiedTraitOutputFormat { |
| 37 |
SUM_OVER_SITES("sumOverAllSites", false), |
| 38 |
SUM_OVER_SITES_WITH_CONDITIONED("sumOverAllSitesWithUnconditioned", true), |
| 39 |
PER_SITE("perSite", false), |
| 40 |
PER_SITE_WITH_UNCONDITIONED("perSiteWithUnconditioned", true), |
| 41 |
ARBITRARY_SITES("arbitrarySites", false), |
| 42 |
ARBITRARY_SITES_WITH_UNCONDITIONED("arbitrarySitesWithUnconditioned", true); |
| 43 |
|
| 44 |
private StratifiedTraitOutputFormat(String text, boolean supportsUnconditioned) { |
| 45 |
this.text = text; |
| 46 |
this.supportsUnconditioned = supportsUnconditioned; |
| 47 |
} |
| 48 |
|
| 49 |
public String getText() { |
| 50 |
return text; |
| 51 |
} |
| 52 |
|
| 53 |
public boolean getSupportsUnconditioned() { |
| 54 |
return supportsUnconditioned; |
| 55 |
} |
| 56 |
|
| 57 |
public static StratifiedTraitOutputFormat parseFromString(String text) { |
| 58 |
for (StratifiedTraitOutputFormat format : StratifiedTraitOutputFormat.values()) { |
| 59 |
if (format.getText().compareToIgnoreCase(text) == 0) |
| 60 |
return format; |
| 61 |
} |
| 62 |
return null; |
| 63 |
} |
| 64 |
|
| 65 |
private final String text; |
| 66 |
private final boolean supportsUnconditioned; |
| 67 |
} |