]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.db/src/org/simantics/db/ConverterComputationalValue.java
Variable optimizations for documents (Simupedia)
[simantics/platform.git] / bundles / org.simantics.db / src / org / simantics / db / ConverterComputationalValue.java
1 /*******************************************************************************
2  * Copyright (c) 2018 Association for Decentralized Information Management in
3  * Industry THTH ry.
4  * All rights reserved. This program and the accompanying materials
5  * are made available under the terms of the Eclipse Public License v1.0
6  * which accompanies this distribution, and is available at
7  * http://www.eclipse.org/legal/epl-v10.html
8  *
9  * Contributors:
10  *     Semantum Oy - initial API and implementation
11  *******************************************************************************/
12 package org.simantics.db;
13
14 import org.simantics.db.exception.DatabaseException;
15 import org.simantics.scl.runtime.function.Function1;
16
17 /**
18  * @author Antti Villberg
19  * @since 1.36.0
20  */
21 public interface ConverterComputationalValue extends ComputationalValue {
22
23     /**
24      * This computes the expression function that shall be called with given context
25      * as defined in
26      * {@link ReadGraph#getRelatedValue2(Resource, Resource, Object, org.simantics.databoard.binding.Binding)}.
27      *
28      * <p>
29      * Context can be Resource (literal) or Variable. With Resource context this
30      * gets called with <code>(null, null, literal resource)</code>. With Variable
31      * property context this gets called with
32      * <code>(represents of parent, represents, predicate resource)</code>.
33      */
34     Function1<Object,Object> getFunction(ReadGraph graph, Resource s, Resource o, Resource p) throws DatabaseException;
35
36 }