| /******************************************************************************* |
| * Copyright (c) 2004-2008 Akos Horvath, Gergely Varro 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: |
| * Akos Horvath, Gergely Varro - initial API and implementation |
| *******************************************************************************/ |
| |
| package org.eclipse.viatra2.gtasm.patternmatcher.impl.gtmatcher.internal.operation;
|
|
|
| import org.eclipse.viatra2.core.IModelManager; |
| import org.eclipse.viatra2.gtasm.patternmatcher.impl.gtmatcher.exceptions.GTOperationException; |
| import org.eclipse.viatra2.gtasm.patternmatcher.impl.patternmatcher.internal.MatchingFrame; |
|
|
|
|
| /**
|
| * @author Akos Horvath
|
| *
|
| */
|
| abstract public class CreateElement extends ElementManipulationOperation{
|
|
|
| //private boolean hasBeenExecuted;
|
| protected IModelManager manager;
|
| protected int variableIndex; |
|
|
| public CreateElement(IModelManager manager, int variableI) {
|
| this.manager = manager;
|
| this.variableIndex = variableI;
|
| }
|
|
|
| public CreateElement(IModelManager m){
|
| this.manager = m; |
| } |
| |
| public boolean update(MatchingFrame frame) throws GTOperationException {
|
| create(frame);
|
| return true;
|
| }
|
|
|
| abstract protected boolean create(MatchingFrame frame) throws GTOperationException;
|
|
|
| /**
|
| * @return the variableIndex
|
| */
|
| public int getVariableIndex() {
|
| return variableIndex;
|
| }
|
|
|
| }
|