]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/adapter/Valuations.java
Migrated source code from Simantics SVN
[simantics/platform.git] / bundles / org.simantics.db.layer0 / src / org / simantics / db / layer0 / adapter / Valuations.java
diff --git a/bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/adapter/Valuations.java b/bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/adapter/Valuations.java
new file mode 100644 (file)
index 0000000..5f59ff1
--- /dev/null
@@ -0,0 +1,69 @@
+/*******************************************************************************\r
+ * Copyright (c) 2007, 2010 Association for Decentralized Information Management\r
+ * in Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ *     VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.db.layer0.adapter;\r
+\r
+import org.simantics.db.ReadGraph;\r
+import org.simantics.db.Resource;\r
+import org.simantics.db.exception.DatabaseException;\r
+\r
+\r
+/*\r
+ * A value address in Simantics e.g.\r
+ * \r
+ *  http://www.mycompany.com/My_Project/My_Model/My_Experiment/Composite1/Component1/Property1\r
+ *  \r
+ *  can be divided into 3 distinct parts.\r
+ * \r
+ *  The model part : http://www.mycompany.com/My_Project/My_Model/\r
+ *  The experiment part : My_Experiment/ \r
+ *  The variable part : Composite1/Component1/Property1\r
+ * \r
+ *  A resource which is part of the flattened structure of a model \r
+ *  \r
+ *  - Can specify uniquely its model part but does not always \r
+ *  - Does not specify the experiment part \r
+ *  - Can uniquely specify some part of the variable part\r
+ *\r
+ *  A variable identity is specified by the model part and the structure part  \r
+ *\r
+ *   -http://www.mycompany.com/My_Project/My_Model/Composite1/Component1/Property1\r
+ *  \r
+ *  Use cases:\r
+ *  \r
+ *   -Browse valid variable identities for selected components (e.g. for selected element in diagram)\r
+ *   -Retrieve values for stored variable suffices (e.g. in monitors or expressions)\r
+ *  \r
+ *  \r
+ *  \r
+ */\r
+\r
+public interface Valuations {\r
+\r
+       /*\r
+        * Produces a resource in the value space specified by the given identity prefix and the given experiment.\r
+        * \r
+        * @param variableIdentityPrefix a prefix which is sufficient to uniquely identify the VariableSpace\r
+        * @param experiment a valid experiment in the model specified by the variable identity\r
+        * @return a resource in a value space\r
+        */\r
+       Resource getValue(ReadGraph graph, String variableIdentityPrefix, String valuation) throws DatabaseException;\r
+\r
+       /*\r
+        * Produces a resource in the value space specified by the given identity prefix and and suffix and the given experiment.\r
+        * \r
+        * @param variableIdentityPrefix a prefix which is sufficient to uniquely identify the VariableSpace\r
+        * @param experiment a valid experiment in the model specified by the variable identity\r
+        * @return a resource in a value space\r
+        */\r
+       Resource getValue(ReadGraph graph, String variableIdentityPrefix, String valuation, String suffix) throws DatabaseException;   \r
+       \r
+}\r