r1564 - branches/migration-200901/simexplorer-is/simexplorer-is-entities/src/main/java/fr/cemagref/simexplorer/is/entities/data
Author: dumoulin Date: 2009-02-25 14:13:26 +0000 (Wed, 25 Feb 2009) New Revision: 1564 Modified: branches/migration-200901/simexplorer-is/simexplorer-is-entities/src/main/java/fr/cemagref/simexplorer/is/entities/data/Component.java branches/migration-200901/simexplorer-is/simexplorer-is-entities/src/main/java/fr/cemagref/simexplorer/is/entities/data/ConstantValue.java branches/migration-200901/simexplorer-is/simexplorer-is-entities/src/main/java/fr/cemagref/simexplorer/is/entities/data/ExplorationData.java Log: IS communication including exploration data. Fixes in IS to be able to have several constant with the same name in an exploration. Modified: branches/migration-200901/simexplorer-is/simexplorer-is-entities/src/main/java/fr/cemagref/simexplorer/is/entities/data/Component.java =================================================================== --- branches/migration-200901/simexplorer-is/simexplorer-is-entities/src/main/java/fr/cemagref/simexplorer/is/entities/data/Component.java 2009-02-23 13:28:04 UTC (rev 1563) +++ branches/migration-200901/simexplorer-is/simexplorer-is-entities/src/main/java/fr/cemagref/simexplorer/is/entities/data/Component.java 2009-02-25 14:13:26 UTC (rev 1564) @@ -163,11 +163,12 @@ @Override public List<Entity> getChildren() { List<Entity> directChildren = super.getChildren(); + directChildren.add(type); + directChildren.add(structures); directChildren.add(constants); - directChildren.add(structures); directChildren.add(codes); + directChildren.add(subComponents); directChildren.add(libraries); - directChildren.add(subComponents); return directChildren; } Modified: branches/migration-200901/simexplorer-is/simexplorer-is-entities/src/main/java/fr/cemagref/simexplorer/is/entities/data/ConstantValue.java =================================================================== --- branches/migration-200901/simexplorer-is/simexplorer-is-entities/src/main/java/fr/cemagref/simexplorer/is/entities/data/ConstantValue.java 2009-02-23 13:28:04 UTC (rev 1563) +++ branches/migration-200901/simexplorer-is/simexplorer-is-entities/src/main/java/fr/cemagref/simexplorer/is/entities/data/ConstantValue.java 2009-02-25 14:13:26 UTC (rev 1564) @@ -31,7 +31,7 @@ private static final long serialVersionUID = 1; /** The value. */ - private String value; + private Object value; /** The constant. */ private Constant constant; @@ -43,7 +43,7 @@ * * @return the value */ - public String getValue() { + public Object getValue() { return value; } @@ -52,7 +52,7 @@ * * @param value the new value */ - public void setValue(String value) { + public void setValue(Object value) { this.value = value; } @@ -91,7 +91,7 @@ List<String> row = new ArrayList<String>(); row.add(""); row.add(constant.toString()); - row.add(value); + row.add(value.toString()); return row; } Modified: branches/migration-200901/simexplorer-is/simexplorer-is-entities/src/main/java/fr/cemagref/simexplorer/is/entities/data/ExplorationData.java =================================================================== --- branches/migration-200901/simexplorer-is/simexplorer-is-entities/src/main/java/fr/cemagref/simexplorer/is/entities/data/ExplorationData.java 2009-02-23 13:28:04 UTC (rev 1563) +++ branches/migration-200901/simexplorer-is/simexplorer-is-entities/src/main/java/fr/cemagref/simexplorer/is/entities/data/ExplorationData.java 2009-02-25 14:13:26 UTC (rev 1564) @@ -1,19 +1,19 @@ /* -* ##% Copyright (C) 2008 Cemagref -* -* 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 3 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/>. -* ##% */ + * ##% Copyright (C) 2008 Cemagref + * + * 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 3 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/>. + * ##% */ package fr.cemagref.simexplorer.is.entities.data; import java.util.List; @@ -29,19 +29,14 @@ /** The Constant serialVersionUID. */ private static final long serialVersionUID = 1; - /** The Constant log. */ - private static final org.apache.commons.logging.Log log = org.apache.commons.logging.LogFactory - .getLog(ExplorationData.class); - + private static final org.apache.commons.logging.Log log = org.apache.commons.logging.LogFactory.getLog(ExplorationData.class); /** The values map. */ private ConstantValues constantValues; - /** The result. */ private Result result; + private static final String[] excludeFields = {"excludeFields", "metadataIS"}; - private static final String[] excludeFields = { "excludeFields", "metadataIS" }; - /** * Find constant value. * @@ -51,11 +46,11 @@ */ private ConstantValue findConstantValue(Constant c) { for (ConstantValue constantValue : constantValues) { - if (c.equals(constantValue.getConstant())) { + if (System.identityHashCode(c) == System.identityHashCode(constantValue.getConstant())) { return constantValue; } } - log.debug("Constant not fund : " + c); + log.debug("Constant not found : " + c); return null; } @@ -65,7 +60,7 @@ * @param c the constant to set * @param value the value */ - public void setConstantValue(Constant c, String value) { + public void setConstantValue(Constant c, Object value) { ConstantValue constantValue = findConstantValue(c); if (constantValue == null) { constantValue = new ConstantValue(); @@ -144,5 +139,4 @@ protected String[] getExcludeFields() { return excludeFields; } - }
participants (1)
-
dumoulinï¼ users.labs.libre-entreprise.org