X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.db.layer0%2Fsrc%2Forg%2Fsimantics%2Fdb%2Flayer0%2Frequest%2FVariableFactoryRequest.java;h=f4272ca919cf9b0a7728e19703f66782a2677ea7;hp=4d456736ffa973d75002357bdea02260c23fba88;hb=a52f0324c9435755d3da3f053794c077f7d58213;hpb=969bd23cab98a79ca9101af33334000879fb60c5 diff --git a/bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/request/VariableFactoryRequest.java b/bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/request/VariableFactoryRequest.java index 4d456736f..f4272ca91 100644 --- a/bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/request/VariableFactoryRequest.java +++ b/bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/request/VariableFactoryRequest.java @@ -1,38 +1,38 @@ -/******************************************************************************* - * Copyright (c) 2007, 2010 Association for Decentralized Information Management - * in Industry THTH ry. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * VTT Technical Research Centre of Finland - initial API and implementation - *******************************************************************************/ -package org.simantics.db.layer0.request; - -import java.util.Collection; - -import org.simantics.db.ReadGraph; -import org.simantics.db.common.request.BinaryRead; -import org.simantics.db.exception.AssumptionException; -import org.simantics.db.exception.DatabaseException; -import org.simantics.db.layer0.variable.Variable; -import org.simantics.db.layer0.variable.VariableFactory; - -public class VariableFactoryRequest extends BinaryRead> { - - public VariableFactoryRequest(Variable variable, VariableFactory factory) { - super(variable, factory); - assert(variable != null); - assert(factory != null); - } - - @Override - public Collection perform(ReadGraph graph) throws DatabaseException { - Collection result = parameter2.evaluate(graph, parameter); - if(result == null) throw new AssumptionException("VariableFactory should not return null."); - return result; - } - -} +/******************************************************************************* + * Copyright (c) 2007, 2010 Association for Decentralized Information Management + * in Industry THTH ry. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * VTT Technical Research Centre of Finland - initial API and implementation + *******************************************************************************/ +package org.simantics.db.layer0.request; + +import java.util.Collection; + +import org.simantics.db.ReadGraph; +import org.simantics.db.common.request.BinaryRead; +import org.simantics.db.exception.AssumptionException; +import org.simantics.db.exception.DatabaseException; +import org.simantics.db.layer0.variable.Variable; +import org.simantics.db.layer0.variable.VariableFactory; + +public class VariableFactoryRequest extends BinaryRead> { + + public VariableFactoryRequest(Variable variable, VariableFactory factory) { + super(variable, factory); + assert(variable != null); + assert(factory != null); + } + + @Override + public Collection perform(ReadGraph graph) throws DatabaseException { + Collection result = parameter2.evaluate(graph, parameter); + if(result == null) throw new AssumptionException("VariableFactory should not return null."); + return result; + } + +}