|
| 1 | +import java.util.Vector; |
| 2 | + |
| 3 | +/****************************** |
| 4 | +* Copyright (c) 2003,2019 Kevin Lano |
| 5 | +* This program and the accompanying materials are made available under the |
| 6 | +* terms of the Eclipse Public License 2.0 which is available at |
| 7 | +* http://www.eclipse.org/legal/epl-2.0 |
| 8 | +* |
| 9 | +* SPDX-License-Identifier: EPL-2.0 |
| 10 | +* *****************************/ |
| 11 | +/* Package: QVT */ |
| 12 | + |
| 13 | +abstract public class QVTRule extends NamedElement |
| 14 | +{ Vector domain = new Vector(); // of Domain |
| 15 | + RelationalTransformation transformation; |
| 16 | + boolean isAbstract = false; |
| 17 | + // QVTRule overrides = null; |
| 18 | + String soverrides = null; |
| 19 | + QVTRule overrides = null; |
| 20 | + |
| 21 | + public QVTRule(String nme, RelationalTransformation t) |
| 22 | + { super(nme); |
| 23 | + transformation = t; |
| 24 | + } |
| 25 | + |
| 26 | + public void addDomain(Domain d) |
| 27 | + { domain.add(d); } |
| 28 | + |
| 29 | + public void setDomain(Vector domains) |
| 30 | + { domain = domains; } |
| 31 | + |
| 32 | + public void setIsAbstract(boolean b) |
| 33 | + { isAbstract = b; } |
| 34 | + |
| 35 | + public boolean isAbstract() |
| 36 | + { return isAbstract; } |
| 37 | + |
| 38 | + public boolean isConcrete() |
| 39 | + { return isAbstract == false; } |
| 40 | + |
| 41 | + public boolean overrides() |
| 42 | + { return soverrides != null; } |
| 43 | + |
| 44 | + public void setOverrides(String superRule) |
| 45 | + { soverrides = superRule; } |
| 46 | + |
| 47 | + public abstract boolean typeCheck(Vector types, Vector entities, Vector contexts, Vector env); |
| 48 | + |
| 49 | + public abstract void addTraceEntity(Vector entities, Vector assocs); |
| 50 | + |
| 51 | + public abstract Vector targetEntities(); |
| 52 | + |
| 53 | + public abstract Vector targetAttributes(); |
| 54 | + |
| 55 | + public abstract Vector sourceAttributes(); |
| 56 | + |
| 57 | + public abstract Expression checkTrace(Entity e, Attribute att); |
| 58 | + |
| 59 | + public abstract Expression checkTraceEmpty(Entity e, Attribute att); |
| 60 | + |
| 61 | + public abstract Vector toConstraints(UseCase uc, Vector entities, Vector types); |
| 62 | + |
| 63 | + /* public abstract Constraint toInverseConstraint(Vector entities, Vector types); */ |
| 64 | + |
| 65 | + public abstract Vector toPreservationConstraints(UseCase uc, Vector entities, Vector types); |
| 66 | + |
| 67 | + /* public abstract Vector toInverseConstraints(Vector entities, Vector types); */ |
| 68 | + |
| 69 | + public abstract int complexity(); |
| 70 | + |
| 71 | + public abstract int cyclomaticComplexity(); |
| 72 | + |
| 73 | + public abstract int epl(); |
| 74 | + |
| 75 | +} |
0 commit comments