Debian Codegraph @

src/dr/evomodel/alloppnet/parsers/AlloppMSCoalescentParser.java

raw symbols SCIP
1 /*
2 * AlloppMSCoalescentParser.java
3 *
4 * Copyright (c) 2002-2017 Alexei Drummond, Andrew Rambaut and Marc Suchard
5 *
6 * This file is part of BEAST.
7 * See the NOTICE file distributed with this work for additional
8 * information regarding copyright ownership and licensing.
9 *
10 * BEAST is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU Lesser General Public License as
12 * published by the Free Software Foundation; either version 2
13 * of the License, or (at your option) any later version.
14 *
15 * BEAST is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License for more details.
19 *
20 * You should have received a copy of the GNU Lesser General Public
21 * License along with BEAST; if not, write to the
22 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
23 * Boston, MA 02110-1301 USA
24 */
25
26 package dr.evomodel.alloppnet.parsers;
27
28 import dr.evomodel.alloppnet.speciation.AlloppMSCoalescent;
29 import dr.evomodel.alloppnet.speciation.AlloppSpeciesBindings;
30 import dr.evomodel.alloppnet.speciation.AlloppSpeciesNetworkModel;
31 import dr.xml.AbstractXMLObjectParser;
32 import dr.xml.ElementRule;
33 import dr.xml.XMLObject;
34 import dr.xml.XMLParseException;
35 import dr.xml.XMLSyntaxRule;
36
37 /**
38 *
39 * @author Graham Jones
40 * Date: 01/07/2011
41 */
42
43 public class AlloppMSCoalescentParser extends AbstractXMLObjectParser {
44
45 public static final String ALLOPPMSCOALESCENT = "apspCoalescent";
46
47
48 public String getParserName() {
49 return ALLOPPMSCOALESCENT;
50 }
51
52
53
54
55 public Object parseXMLObject(XMLObject xo) throws XMLParseException {
56 final AlloppSpeciesBindings apsp = (AlloppSpeciesBindings) xo.getChild(AlloppSpeciesBindings.class);
57 final AlloppSpeciesNetworkModel apspnetwork =
58 (AlloppSpeciesNetworkModel) xo.getChild(AlloppSpeciesNetworkModel.class);
59 return new AlloppMSCoalescent(apsp, apspnetwork);
60 }
61
62 public XMLSyntaxRule[] getSyntaxRules() {
63 return new XMLSyntaxRule[]{
64 new ElementRule(AlloppSpeciesBindings.class),
65 new ElementRule(AlloppSpeciesNetworkModel.class),
66 };
67 }
68
69
70
71 @Override
72 public String getParserDescription() {
73 return "Likelihood of a set of gene trees embedded in a allopolyploid species network.";
74 }
75
76 @Override
77 public Class getReturnType() {
78 return AlloppMSCoalescent.class;
79 }
80
81 }