| /******************************************************************************* |
| * 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.validation;
|
|
|
| import java.util.ArrayList; |
| import java.util.Collection; |
| |
| import org.eclipse.viatra2.gtasm.patternmatcher.impl.gtmatcher.internal.operation.CreateElement; |
| import org.eclipse.viatra2.gtasm.patternmatcher.impl.gtmatcher.internal.operation.DeleteElement; |
| import org.eclipse.viatra2.gtasm.patternmatcher.impl.gtmatcher.internal.operation.MoveElement; |
| import org.eclipse.viatra2.gtasm.patternmatcher.impl.gtmatcher.internal.operation.SetRelation; |
|
|
|
|
| /** Holds the operations that needs to be validated
|
| * @author Akos Horvath
|
| *
|
| */
|
| public class GTValidationElement {
|
|
|
| Collection<DeleteElement> delOperations;
|
| Collection<CreateElement> createOperations;
|
| Collection<MoveElement> moveOperations;
|
| Collection<SetRelation> setOperations;
|
|
|
| //related operation, where the element is only used as a target or a source
|
| //Collection<DeleteElement> relatedDelOperations;
|
| Collection<CreateElement> relatedCreateOperations;
|
| Collection<MoveElement> relatedMoveOperations;
|
| Collection<SetRelation> relatedSetOperations;
|
|
|
| public GTValidationElement(){
|
| delOperations = new ArrayList<DeleteElement>();
|
| createOperations = new ArrayList<CreateElement>();
|
| moveOperations = new ArrayList<MoveElement>();
|
| setOperations = new ArrayList<SetRelation>();
|
|
|
| //relatedDelOperations = new ArrayList<DeleteElement>();
|
| relatedCreateOperations = new ArrayList<CreateElement>();
|
| relatedMoveOperations = new ArrayList<MoveElement>();
|
| relatedSetOperations = new ArrayList<SetRelation>();
|
|
|
| }
|
|
|
| /**
|
| * @return the createOperations
|
| */
|
| public Collection<CreateElement> getCreateOperations() {
|
| return createOperations;
|
| }
|
| /**
|
| * @return the delOperations
|
| */
|
| public Collection<DeleteElement> getDelOperations() {
|
| return delOperations;
|
| }
|
| /**
|
| * @return the moveOperations
|
| */
|
| public Collection<MoveElement> getMoveOperations() {
|
| return moveOperations;
|
| }
|
| /**
|
| * @return the setOperations
|
| */
|
| public Collection<SetRelation> getSetOperations() {
|
| return setOperations;
|
| }
|
| /** Adds the operation to the appropriate collection
|
| * @param op
|
| */
|
| public void addCreateOperation(CreateElement op){
|
| createOperations.add(op);
|
| }
|
| /** Adds the operation to the appropriate collection
|
| * @param op
|
| */
|
| public void addDelOperation(DeleteElement op){
|
| delOperations.add(op);
|
| }
|
| /** Adds the operation to the appropriate collection
|
| * @param op
|
| */
|
| public void addMoveOperation(MoveElement op){
|
| moveOperations.add(op);
|
| }
|
| /** Adds the operation to the appropriate collection
|
| * @param op
|
| */
|
| public void addSetOperation(SetRelation op){
|
| setOperations.add(op);
|
| }
|
|
|
| /**
|
| * @return the relatedCreateOperations
|
| */
|
| public Collection<CreateElement> getRelatedCreateOperations() {
|
| return relatedCreateOperations;
|
| }
|
|
|
| // /**
|
| // * @return the relatedDelOperations
|
| // */
|
| // public Collection<DeleteElement> getRelatedDelOperations() {
|
| // return relatedDelOperations;
|
| // }
|
| //
|
| /**
|
| * @return the relatedMoveOperations
|
| */
|
| public Collection<MoveElement> getRelatedMoveOperations() {
|
| return relatedMoveOperations;
|
| }
|
|
|
| /**
|
| * @return the relatedSetOperations
|
| */
|
| public Collection<SetRelation> getRelatedSetOperations() {
|
| return relatedSetOperations;
|
| }
|
|
|
| /** Adds the operation to the appropriate collection
|
| * @param op
|
| */
|
| public void addRelatedCreateOperation(CreateElement op){
|
| relatedCreateOperations.add(op);
|
| }
|
| /** Adds the operation to the appropriate collection
|
| * @param op
|
| */
|
| // public void addRelatedDelOperation(DeleteElement op){
|
| // relatedDelOperations.add(op);
|
| // }
|
| /** Adds the operation to the appropriate collection
|
| * @param op
|
| */
|
| public void addRelatedMoveOperation(MoveElement op){
|
| relatedMoveOperations.add(op);
|
| }
|
| /** Adds the operation to the appropriate collection
|
| * @param op
|
| */
|
| public void addRelatedSetOperation(SetRelation op){
|
| relatedSetOperations.add(op);
|
| }
|
|
|
|
|
| }
|