| /******************************************************************************* |
| * 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.patternmatcher.internal.searchgraph;
|
|
|
| import org.eclipse.emf.ecore.EObject;
|
| import org.eclipse.viatra2.gtasm.patternmatcher.impl.patternmatcher.internal.EdgeType; |
| import org.eclipse.viatra2.gtasm.patternmatcher.impl.patternmatcher.internal.searchgraph.EdgeTypeinAlgorithm; |
| import org.eclipse.viatra2.gtasm.patternmatcher.impl.patternmatcher.internal.searchgraph.SearchGraphNode; |
| import org.eclipse.viatra2.gtasm.patternmatcher.impl.patternmatcher.internal.searchgraph.traceability.AbstractTraceabilityElement; |
| import org.eclipse.viatra2.gtasm.patternmatcher.impl.patternmatcher.internal.searchgraph.traceability.EdgeTraceabilityElement; |
|
|
|
|
| public class SearchGraphEdge extends AbstractNode {
|
| private int oldWeight = -1, weight = -1, idinSearchPath= -1;
|
| private EdgeTypeinAlgorithm type = EdgeTypeinAlgorithm.FREE;
|
| private SearchGraphNode targetNode, sourceNode;
|
| private EdgeType vpmEdgetype;
|
| private SearchGraphEdge inverseEdge = null;
|
| private boolean isSource; |
| private EdgeTraceabilityElement traceabilityElement;
|
|
|
| public int getOldWeight() {
|
| return oldWeight;
|
| }
|
|
|
| public void setOldWeight(int oldWeight) {
|
| this.oldWeight = oldWeight;
|
| }
|
|
|
| public int getWeight() {
|
| return weight;
|
| }
|
|
|
| public void setWeight(int weight) {
|
| this.weight = weight;
|
| }
|
|
|
| public EdgeTypeinAlgorithm getEdgeTypeinAlgorithm() {
|
| return type;
|
| }
|
|
|
| public void setEdgeTypeinAlgorithm(EdgeTypeinAlgorithm type) {
|
| this.type = type;
|
| }
|
|
|
| public int getIdinSearchPath() {
|
| return idinSearchPath;
|
| }
|
|
|
| public void setIdinSearchPath(int idinSearchPath) {
|
| this.idinSearchPath = idinSearchPath;
|
| }
|
|
|
| public SearchGraphNode getSourceNode() {
|
| return sourceNode;
|
| }
|
|
|
| public void setSourceNode(SearchGraphNode sourceNode) {
|
| this.sourceNode = sourceNode;
|
| }
|
|
|
| public SearchGraphNode getTargetNode() {
|
| return targetNode;
|
| }
|
|
|
| public void setTargetNode(SearchGraphNode targetNode) {
|
| this.targetNode = targetNode;
|
| }
|
|
|
| public EdgeType getVPMEdgeType() {
|
| return vpmEdgetype;
|
| }
|
|
|
| public void setVPMEdgeType(EdgeType vpmEdgetype) {
|
| this.vpmEdgetype = vpmEdgetype;
|
| }
|
|
|
| public boolean isSource() {
|
| return isSource;
|
| }
|
|
|
| public void setSource(boolean isSource) {
|
| this.isSource = isSource;
|
| }
|
|
|
| /**
|
| * @return the inverseEdge
|
| */
|
| public SearchGraphEdge getInverseEdge() {
|
| return inverseEdge;
|
| }
|
|
|
| /**
|
| * @param inverseEdge the inverseEdge to set
|
| */
|
| public void setInverseEdge(SearchGraphEdge inverseEdge) {
|
| this.inverseEdge = inverseEdge;
|
| inverseEdge.NonRecursiveInverseEdgeSet(this);
|
| }
|
|
|
| /**
|
| * @param inverseEdge the inverseEdge to set
|
| */
|
| private void NonRecursiveInverseEdgeSet(SearchGraphEdge inverseEdge) {
|
| this.inverseEdge = inverseEdge;
|
| }
|
| /* (non-Javadoc)
|
| * @see org.eclipse.viatra2.gtasm.patternmatcher.internal.AbstractNode#setChecked(boolean)
|
| */
|
| @Override
|
| public void setChecked(boolean checked) {
|
| super.setChecked(checked);
|
| if(inverseEdge != null)
|
| inverseEdge.nonRecursiveSetChecked(checked);
|
| }
|
|
|
| private void nonRecursiveSetChecked(boolean checked) {
|
| super.setChecked(checked);
|
|
|
| }
|
|
|
| /* (non-Javadoc)
|
| * @see org.eclipse.viatra2.gtasm.patternmatcher.internal.AbstractNode#clear()
|
| */
|
| @Override
|
| public void clear() {
|
| //super.clear();
|
| setChecked(false);
|
| } |
| |
| @Override |
| public EdgeTraceabilityElement getTraceabilityElement() { |
| return traceabilityElement; |
| } |
| |
| public void setTraceabilityElement(EdgeTraceabilityElement element) { |
| traceabilityElement = element; |
| }
|
|
|
| }
|