]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.simulation/src/org/simantics/simulation/data/VariableHandle.java
Simulator toolkit enhancements
[simantics/platform.git] / bundles / org.simantics.simulation / src / org / simantics / simulation / data / VariableHandle.java
1 /*******************************************************************************
2  * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  *     VTT Technical Research Centre of Finland - initial API and implementation
10  *******************************************************************************/
11 package org.simantics.simulation.data;
12
13 import org.simantics.databoard.accessor.error.AccessorException;
14 import org.simantics.databoard.binding.Binding;
15
16 /**
17  * A handle to a variable of a {@link Datasource}.
18  *
19  * @author Toni Kalajainen <toni.kalajainen@vtt.fi>
20  */
21 public interface VariableHandle {
22
23         /**
24          * @return key (ID) of the variable
25          */
26         String key();
27
28         /**
29          * @return binding for the variable
30          */
31         Binding binding();
32
33         /**
34          * @return current value associated with this handle
35          * @throws AccessorException if value cannot be retrieved
36          */
37         Object getValue() throws AccessorException;
38
39         /**
40          * @return current value associated with this handle within the given Datasource
41          * @throws AccessorException if value cannot be retrieved
42          */
43         Object getValue(Datasource datasource) throws AccessorException;
44         
45         /**
46          * Frees any resource related to this handle.
47          */
48         void dispose();
49
50 }
51