Author: glandais Date: 2007-12-05 15:24:28 +0000 (Wed, 05 Dec 2007) New Revision: 42 Modified: trunk/simexplorer-si-storage/src/java/org/cemagref/simexplorer/si/storage/entities/Component.java trunk/simexplorer-si-storage/src/java/org/cemagref/simexplorer/si/storage/entities/Constant.java trunk/simexplorer-si-storage/src/java/org/cemagref/simexplorer/si/storage/entities/ConstantValue.java trunk/simexplorer-si-storage/src/java/org/cemagref/simexplorer/si/storage/entities/ExplorationApplication.java trunk/simexplorer-si-storage/src/java/org/cemagref/simexplorer/si/storage/entities/ExplorationData.java trunk/simexplorer-si-storage/src/java/org/cemagref/simexplorer/si/storage/entities/Library.java trunk/simexplorer-si-storage/src/java/org/cemagref/simexplorer/si/storage/entities/LoggableElement.java Log: Entities update Modified: trunk/simexplorer-si-storage/src/java/org/cemagref/simexplorer/si/storage/entities/Component.java =================================================================== --- trunk/simexplorer-si-storage/src/java/org/cemagref/simexplorer/si/storage/entities/Component.java 2007-12-05 15:23:47 UTC (rev 41) +++ trunk/simexplorer-si-storage/src/java/org/cemagref/simexplorer/si/storage/entities/Component.java 2007-12-05 15:24:28 UTC (rev 42) @@ -1,6 +1,5 @@ package org.cemagref.simexplorer.si.storage.entities; -import java.util.HashSet; import java.util.Set; public class Component extends LoggableElement { @@ -9,14 +8,37 @@ Set<Structure> structures; Set<Code> codes; Set<Library> libraries; - - @Override - public Set<LoggableElement> getChildren() { - Set<LoggableElement> children = new HashSet<LoggableElement>(); - if (libraries != null) { - children.addAll(libraries); - } - return children; + + public Set<Constant> getConstants() { + return constants; } - + + public void setConstants(Set<Constant> constants) { + this.constants = constants; + } + + public Set<Structure> getStructures() { + return structures; + } + + public void setStructures(Set<Structure> structures) { + this.structures = structures; + } + + public Set<Code> getCodes() { + return codes; + } + + public void setCodes(Set<Code> codes) { + this.codes = codes; + } + + public Set<Library> getLibraries() { + return libraries; + } + + public void setLibraries(Set<Library> libraries) { + this.libraries = libraries; + } + } Modified: trunk/simexplorer-si-storage/src/java/org/cemagref/simexplorer/si/storage/entities/Constant.java =================================================================== --- trunk/simexplorer-si-storage/src/java/org/cemagref/simexplorer/si/storage/entities/Constant.java 2007-12-05 15:23:47 UTC (rev 41) +++ trunk/simexplorer-si-storage/src/java/org/cemagref/simexplorer/si/storage/entities/Constant.java 2007-12-05 15:24:28 UTC (rev 42) @@ -4,18 +4,21 @@ private String name; private Class type; - + public String getName() { return name; } + public void setName(String name) { this.name = name; } + public Class getType() { return type; } + public void setType(Class type) { this.type = type; } - + } Modified: trunk/simexplorer-si-storage/src/java/org/cemagref/simexplorer/si/storage/entities/ConstantValue.java =================================================================== --- trunk/simexplorer-si-storage/src/java/org/cemagref/simexplorer/si/storage/entities/ConstantValue.java 2007-12-05 15:23:47 UTC (rev 41) +++ trunk/simexplorer-si-storage/src/java/org/cemagref/simexplorer/si/storage/entities/ConstantValue.java 2007-12-05 15:24:28 UTC (rev 42) @@ -2,13 +2,13 @@ public class ConstantValue implements Entity { - private Object value; + private String value; private Constant constant; - public Object getValue() { + public String getValue() { return value; } - public void setValue(Object value) { + public void setValue(String value) { this.value = value; } public Constant getConstant() { Modified: trunk/simexplorer-si-storage/src/java/org/cemagref/simexplorer/si/storage/entities/ExplorationApplication.java =================================================================== --- trunk/simexplorer-si-storage/src/java/org/cemagref/simexplorer/si/storage/entities/ExplorationApplication.java 2007-12-05 15:23:47 UTC (rev 41) +++ trunk/simexplorer-si-storage/src/java/org/cemagref/simexplorer/si/storage/entities/ExplorationApplication.java 2007-12-05 15:24:28 UTC (rev 42) @@ -22,17 +22,4 @@ this.components = components; } - @Override - public Set<LoggableElement> getChildren() { - Set<LoggableElement> children = new HashSet<LoggableElement>(); - if (explorations != null) { - children.addAll(explorations); - } - if (components != null) { - children.addAll(components); - } - return children; - } - - } Modified: trunk/simexplorer-si-storage/src/java/org/cemagref/simexplorer/si/storage/entities/ExplorationData.java =================================================================== --- trunk/simexplorer-si-storage/src/java/org/cemagref/simexplorer/si/storage/entities/ExplorationData.java 2007-12-05 15:23:47 UTC (rev 41) +++ trunk/simexplorer-si-storage/src/java/org/cemagref/simexplorer/si/storage/entities/ExplorationData.java 2007-12-05 15:24:28 UTC (rev 42) @@ -1,23 +1,22 @@ package org.cemagref.simexplorer.si.storage.entities; -import java.util.HashSet; import java.util.Set; public class ExplorationData extends LoggableElement { private Set<ConstantValue> valuesMap; private Result result; - + private ConstantValue findConstantValue(Constant c) { for (ConstantValue constantValue : valuesMap) { if (c.equals(constantValue.getConstant())) { return constantValue; } - } + } return null; } - - public void setConstantValue(Constant c, Object value) { + + public void setConstantValue(Constant c, String value) { ConstantValue constantValue = findConstantValue(c); if (constantValue == null) { constantValue = new ConstantValue(); @@ -26,7 +25,7 @@ } constantValue.setValue(value); } - + public Object getConstantValue(Constant c) { ConstantValue constantValue = findConstantValue(c); if (constantValue == null) { @@ -44,8 +43,12 @@ this.result = result; } - @Override - public Set<LoggableElement> getChildren() { - return new HashSet<LoggableElement>(); - } + public Set<ConstantValue> getValuesMap() { + return valuesMap; + } + + public void setValuesMap(Set<ConstantValue> valuesMap) { + this.valuesMap = valuesMap; + } + } Modified: trunk/simexplorer-si-storage/src/java/org/cemagref/simexplorer/si/storage/entities/Library.java =================================================================== --- trunk/simexplorer-si-storage/src/java/org/cemagref/simexplorer/si/storage/entities/Library.java 2007-12-05 15:23:47 UTC (rev 41) +++ trunk/simexplorer-si-storage/src/java/org/cemagref/simexplorer/si/storage/entities/Library.java 2007-12-05 15:24:28 UTC (rev 42) @@ -1,14 +1,6 @@ package org.cemagref.simexplorer.si.storage.entities; -import java.util.HashSet; -import java.util.Set; - public class Library extends LoggableElement { - @Override - public Set<LoggableElement> getChildren() { - return new HashSet<LoggableElement>(); - } - } Modified: trunk/simexplorer-si-storage/src/java/org/cemagref/simexplorer/si/storage/entities/LoggableElement.java =================================================================== --- trunk/simexplorer-si-storage/src/java/org/cemagref/simexplorer/si/storage/entities/LoggableElement.java 2007-12-05 15:23:47 UTC (rev 41) +++ trunk/simexplorer-si-storage/src/java/org/cemagref/simexplorer/si/storage/entities/LoggableElement.java 2007-12-05 15:24:28 UTC (rev 42) @@ -3,8 +3,6 @@ import java.util.Date; import java.util.Set; -import org.apache.lucene.document.Document; - public abstract class LoggableElement implements Entity { private String uuid; @@ -16,8 +14,10 @@ private Date creationDate; private String hash; private Set<Descriptor> descriptors; + /* private LoggableElement parent; private Set<LoggableElement> children; + */ public String getUuid() { return uuid; @@ -91,6 +91,7 @@ this.descriptors = descriptors; } + /* public LoggableElement getParent() { return parent; } @@ -106,12 +107,6 @@ public void setVersionChildren(Set<LoggableElement> children) { this.children = children; } - - /** - * Returns children list - * Should not be null - * @return Children list - */ - public abstract Set<LoggableElement> getChildren(); + */ }
participants (1)
-
glandais@users.labs.libre-entreprise.org