| /******************************************************************************* |
| * Copyright (c) 2004-2008 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.simple.legacy; |
| |
| import org.eclipse.viatra2.gtasmmodel.gtasm.metamodel.asm.definitions.Variable; |
| import org.eclipse.viatra2.gtasmmodel.vpm.editmodel.ModelElement; |
| |
| class PatternNode extends PatternNodeBase implements Comparable<PatternNode> { |
| /** |
| * An editmodel element corresponding to this variable, if there are any. |
| */ |
| public ModelElement source; |
| |
| /* |
| * public PatternNode(Entity entity) { this(entity.getName(), null, true, |
| * false, false); entities.add(entity); } |
| */ |
| |
| public PatternNode(Variable variable/* , boolean isEntity */) { |
| super(variable.getName()/* , isEntity */); |
| } |
| |
| // virtual variable: constant or term substitution |
| public PatternNode(int newId) { |
| super(".virtual{" + newId + "}", /* false, */true, true /* |
| * virtual nodes |
| * are |
| * considered |
| * touched |
| */); |
| // this.entities = new LinkedList<Entity>(); |
| // this.isEntity = false; |
| } |
| |
| /** |
| * @param entity |
| * the entity to set |
| */ |
| public void setSource(ModelElement source) { |
| this.source = source; |
| } |
| |
| } |