]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/adapter/Valuations.java
Sync git svn branch with SVN repository r33389.
[simantics/platform.git] / bundles / org.simantics.db.layer0 / src / org / simantics / db / layer0 / adapter / Valuations.java
1 /*******************************************************************************\r
2  * Copyright (c) 2007, 2010 Association for Decentralized Information Management\r
3  * in Industry THTH ry.\r
4  * All rights reserved. This program and the accompanying materials\r
5  * are made available under the terms of the Eclipse Public License v1.0\r
6  * which accompanies this distribution, and is available at\r
7  * http://www.eclipse.org/legal/epl-v10.html\r
8  *\r
9  * Contributors:\r
10  *     VTT Technical Research Centre of Finland - initial API and implementation\r
11  *******************************************************************************/\r
12 package org.simantics.db.layer0.adapter;\r
13 \r
14 import org.simantics.db.ReadGraph;\r
15 import org.simantics.db.Resource;\r
16 import org.simantics.db.exception.DatabaseException;\r
17 \r
18 \r
19 /*\r
20  * A value address in Simantics e.g.\r
21  * \r
22  *  http://www.mycompany.com/My_Project/My_Model/My_Experiment/Composite1/Component1/Property1\r
23  *  \r
24  *  can be divided into 3 distinct parts.\r
25  * \r
26  *  The model part : http://www.mycompany.com/My_Project/My_Model/\r
27  *  The experiment part : My_Experiment/ \r
28  *  The variable part : Composite1/Component1/Property1\r
29  * \r
30  *  A resource which is part of the flattened structure of a model \r
31  *  \r
32  *  - Can specify uniquely its model part but does not always \r
33  *  - Does not specify the experiment part \r
34  *  - Can uniquely specify some part of the variable part\r
35  *\r
36  *  A variable identity is specified by the model part and the structure part  \r
37  *\r
38  *   -http://www.mycompany.com/My_Project/My_Model/Composite1/Component1/Property1\r
39  *  \r
40  *  Use cases:\r
41  *  \r
42  *   -Browse valid variable identities for selected components (e.g. for selected element in diagram)\r
43  *   -Retrieve values for stored variable suffices (e.g. in monitors or expressions)\r
44  *  \r
45  *  \r
46  *  \r
47  */\r
48 \r
49 public interface Valuations {\r
50 \r
51         /*\r
52          * Produces a resource in the value space specified by the given identity prefix and the given experiment.\r
53          * \r
54          * @param variableIdentityPrefix a prefix which is sufficient to uniquely identify the VariableSpace\r
55          * @param experiment a valid experiment in the model specified by the variable identity\r
56          * @return a resource in a value space\r
57          */\r
58         Resource getValue(ReadGraph graph, String variableIdentityPrefix, String valuation) throws DatabaseException;\r
59 \r
60         /*\r
61          * Produces a resource in the value space specified by the given identity prefix and and suffix and the given experiment.\r
62          * \r
63          * @param variableIdentityPrefix a prefix which is sufficient to uniquely identify the VariableSpace\r
64          * @param experiment a valid experiment in the model specified by the variable identity\r
65          * @return a resource in a value space\r
66          */\r
67         Resource getValue(ReadGraph graph, String variableIdentityPrefix, String valuation, String suffix) throws DatabaseException;   \r
68         \r
69 }\r