| 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 |
|
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
package dr.evomodelxml.coalescent; |
| 31 |
|
| 32 |
import dr.evolution.tree.Tree; |
| 33 |
import dr.evomodel.coalescent.CoalescentTreeIntervalStatistic; |
| 34 |
import dr.xml.AbstractXMLObjectParser; |
| 35 |
import dr.xml.ElementRule; |
| 36 |
import dr.xml.XMLObject; |
| 37 |
import dr.xml.XMLParseException; |
| 38 |
import dr.xml.XMLSyntaxRule; |
| 39 |
|
| 40 |
|
| 41 |
public class CoalescentTreeIntervalStatisticParser extends AbstractXMLObjectParser { |
| 42 |
|
| 43 |
public static final String COALESCENT_TREE_INTERVAL_STATISTIC = "coalescentTreeIntervalStatistic"; |
| 44 |
|
| 45 |
public String getParserDescription() { |
| 46 |
return ""; |
| 47 |
} |
| 48 |
|
| 49 |
public Class getReturnType() { |
| 50 |
return CoalescentTreeIntervalStatistic.class; |
| 51 |
} |
| 52 |
|
| 53 |
public XMLSyntaxRule[] getSyntaxRules() { |
| 54 |
return new XMLSyntaxRule[]{ |
| 55 |
new ElementRule(Tree.class), |
| 56 |
}; |
| 57 |
} |
| 58 |
|
| 59 |
public Object parseXMLObject(XMLObject xo) throws XMLParseException { |
| 60 |
Tree tree = (Tree) xo.getChild(Tree.class); |
| 61 |
return new CoalescentTreeIntervalStatistic(tree); |
| 62 |
} |
| 63 |
|
| 64 |
public String getParserName() { |
| 65 |
return COALESCENT_TREE_INTERVAL_STATISTIC; |
| 66 |
} |
| 67 |
|
| 68 |
} |