r3344 - isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/mexico/xml
Author: chatellier Date: 2011-05-31 14:16:54 +0000 (Tue, 31 May 2011) New Revision: 3344 Log: Rename RuleDomain to RuleDiscreteDomain Added: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/mexico/xml/RuleDiscreteDomainXMLVisitor.java Removed: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/mexico/xml/RuleDomainXMLVisitor.java Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/mexico/xml/FactorXMLVisitor.java Modified: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/mexico/xml/FactorXMLVisitor.java =================================================================== --- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/mexico/xml/FactorXMLVisitor.java 2011-05-31 09:31:19 UTC (rev 3343) +++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/mexico/xml/FactorXMLVisitor.java 2011-05-31 14:16:54 UTC (rev 3344) @@ -25,11 +25,8 @@ package fr.ifremer.isisfish.mexico.xml; -import java.io.Serializable; - import org.nuiton.math.matrix.MatrixND; -import fr.ifremer.isisfish.rule.Rule; import fr.ifremer.isisfish.simulator.sensitivity.Domain; import fr.ifremer.isisfish.simulator.sensitivity.Factor; import fr.ifremer.isisfish.simulator.sensitivity.domain.ContinuousDomain; @@ -123,7 +120,7 @@ visitor = new ContinuousDomainXMLVisitor(); } else if (factor.getDomain() instanceof RuleDiscreteDomain) { - visitor = new RuleDomainXMLVisitor(); + visitor = new RuleDiscreteDomainXMLVisitor(); } else if (factor.getDomain() instanceof DiscreteDomain) { visitor = new DiscreteDomainXMLVisitor(); Copied: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/mexico/xml/RuleDiscreteDomainXMLVisitor.java (from rev 3334, isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/mexico/xml/RuleDomainXMLVisitor.java) =================================================================== --- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/mexico/xml/RuleDiscreteDomainXMLVisitor.java (rev 0) +++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/mexico/xml/RuleDiscreteDomainXMLVisitor.java 2011-05-31 14:16:54 UTC (rev 3344) @@ -0,0 +1,57 @@ +/* + * #%L + * IsisFish + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2011 Ifremer, CodeLutin, Chatellier Eric + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 2 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/gpl-2.0.html>. + * #L% + */ + +package fr.ifremer.isisfish.mexico.xml; + +import java.util.List; + +import fr.ifremer.isisfish.mexico.MexicoHelper; +import fr.ifremer.isisfish.rule.Rule; +import fr.ifremer.isisfish.simulator.sensitivity.Domain; + +/** + * XML rule domain visitor. + * + * @author chatellier + * @version $Revision$ + * + * Last update : $Date$ + * By : $Author$ + */ +public class RuleDiscreteDomainXMLVisitor extends DiscreteDomainXMLVisitor { + + /** + * {@inheritDoc} + */ + @Override + public void visit(Domain domain, Object label, Object value) { + List<Rule> rulesList = (List<Rule>)value; + String rulesAsXml = MexicoHelper.getRulesAsXml(rulesList); + + xmlBuffer.append("<value>"); + xmlBuffer.append(rulesAsXml); + xmlBuffer.append("</value>"); + } +} Deleted: isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/mexico/xml/RuleDomainXMLVisitor.java =================================================================== --- isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/mexico/xml/RuleDomainXMLVisitor.java 2011-05-31 09:31:19 UTC (rev 3343) +++ isis-fish/branches/3.3.1/src/main/java/fr/ifremer/isisfish/mexico/xml/RuleDomainXMLVisitor.java 2011-05-31 14:16:54 UTC (rev 3344) @@ -1,57 +0,0 @@ -/* - * #%L - * IsisFish - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2011 Ifremer, CodeLutin, Chatellier Eric - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as - * published by the Free Software Foundation, either version 2 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program. If not, see - * <http://www.gnu.org/licenses/gpl-2.0.html>. - * #L% - */ - -package fr.ifremer.isisfish.mexico.xml; - -import java.util.List; - -import fr.ifremer.isisfish.mexico.MexicoHelper; -import fr.ifremer.isisfish.rule.Rule; -import fr.ifremer.isisfish.simulator.sensitivity.Domain; - -/** - * XML rule domain visitor. - * - * @author chatellier - * @version $Revision$ - * - * Last update : $Date$ - * By : $Author$ - */ -public class RuleDomainXMLVisitor extends DiscreteDomainXMLVisitor { - - /** - * {@inheritDoc} - */ - @Override - public void visit(Domain domain, Object label, Object value) { - List<Rule> rulesList = (List<Rule>)value; - String rulesAsXml = MexicoHelper.getRulesAsXml(rulesList); - - xmlBuffer.append("<value>"); - xmlBuffer.append(rulesAsXml); - xmlBuffer.append("</value>"); - } -}
participants (1)
-
chatellierï¼ users.labs.libre-entreprise.org