blob: d91b5dabf58d9210ced8b416f6ec8b6345e05aba [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2004-2010 Gabor Bergmann and Daniel Varro
* 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:
* Gabor Bergmann - initial API and implementation
*******************************************************************************/
package org.eclipse.viatra2.gtasm.patternmatcher.incremental.rete.construction.psystem.basicenumerables;
import org.eclipse.viatra2.gtasm.patternmatcher.incremental.rete.construction.Buildable;
import org.eclipse.viatra2.gtasm.patternmatcher.incremental.rete.construction.RetePatternBuildException;
import org.eclipse.viatra2.gtasm.patternmatcher.incremental.rete.construction.Stub;
import org.eclipse.viatra2.gtasm.patternmatcher.incremental.rete.construction.psystem.KeyedEnumerablePConstraint;
import org.eclipse.viatra2.gtasm.patternmatcher.incremental.rete.construction.psystem.PVariable; import org.eclipse.viatra2.gtasm.patternmatcher.incremental.rete.construction.psystem.PSystem;
import org.eclipse.viatra2.gtasm.patternmatcher.incremental.rete.tuple.FlatTuple;
/**
* @author Bergmann Gábor
*
*/
public class ConstantValue<PatternDescription, StubHandle>
extends
KeyedEnumerablePConstraint<Object, PatternDescription, StubHandle> {
/**
* @param buildable
* @param variablesTuple
* @param supplierKey
*/
public ConstantValue(
PSystem<PatternDescription, StubHandle, ?> pSystem,
PVariable variable, Object value)
{
super(pSystem, new FlatTuple(variable), value);
}
/* (non-Javadoc)
* @see org.eclipse.viatra2.gtasm.patternmatcher.incremental.rete.construction.psystem.EnumerablePConstraint#doCreateStub()
*/
@Override
public Stub<StubHandle> doCreateStub() throws RetePatternBuildException {
return buildable.buildStartStub(new Object[]{supplierKey}, this.variablesTuple.getElements());
}
}