1 | /** | | 1 | public List getInEdges(Object port) { |
2 | * Validate every association for the given relation. | | 2 | List res = new ArrayList(); |
3 | * | | 3 | if (Model.getFacade().isANode(port)) { |
4 | * @param relation | | 4 | Collection ends = Model.getFacade().getAssociationEnds(port); |
5 | */ | | 5 | if (ends == null) { |
6 | private void validateAssociations(Object relation) { | | 6 | return Collections.EMPTY_LIST; |
7 | Collection associationEnds = Model.getFacade().getAssociationEnds( | | 7 | } |
8 | relation); | | 8 | for (Object end : ends) { |
9 | Iterator it = associationEnds.iterator(); | | 9 | res.add(Model.getFacade().getAssociation(end)); |
10 | while (it.hasNext()) { | | 10 | } |
11 | Object relationAssocEnd = it.next(); | | 11 | } |
12 | Object association = Model.getFacade().getAssociation( | | 12 | if (Model.getFacade().isANodeInstance(port)) { |
13 | relationAssocEnd); | | 13 | Object noi = port; |
14 | validateAssociation(association); | | 14 | Collection ends = Model.getFacade().getLinkEnds(noi); |
15 | } | | 15 | res.addAll(ends); |
16 | } | | 16 | } |
| | | 17 | if (Model.getFacade().isAComponent(port)) { |
| | | 18 | Collection ends = Model.getFacade().getAssociationEnds(port); |
| | | 19 | if (ends == null) { |
| | | 20 | return Collections.EMPTY_LIST; |
| | | 21 | } |
| | | 22 | for (Object end : ends) { |
| | | 23 | res.add(Model.getFacade().getAssociation(end)); |
| | | 24 | } |
| | | 25 | } |
| | | 26 | if (Model.getFacade().isAComponentInstance(port)) { |
| | | 27 | Object coi = port; |
| | | 28 | Collection ends = Model.getFacade().getLinkEnds(coi); |
| | | 29 | res.addAll(ends); |
| | | 30 | } |
| | | 31 | if (Model.getFacade().isAClass(port)) { |
| | | 32 | Collection ends = Model.getFacade().getAssociationEnds(port); |
| | | 33 | if (ends == null) { |
| | | 34 | return Collections.EMPTY_LIST; |
| | | 35 | } |
| | | 36 | for (Object end : ends) { |
| | | 37 | res.add(Model.getFacade().getAssociation(end)); |
| | | 38 | } |
| | | 39 | } |
| | | 40 | if (Model.getFacade().isAInterface(port)) { |
| | | 41 | Collection ends = Model.getFacade().getAssociationEnds(port); |
| | | 42 | if (ends == null) { |
| | | 43 | return Collections.EMPTY_LIST; |
| | | 44 | } |
| | | 45 | for (Object end : ends) { |
| | | 46 | res.add(Model.getFacade().getAssociation(end)); |
| | | 47 | } |
| | | 48 | } |
| | | 49 | if (Model.getFacade().isAObject(port)) { |
| | | 50 | Object clo = port; |
| | | 51 | Collection ends = Model.getFacade().getLinkEnds(clo); |
| | | 52 | res.addAll(ends); |
| | | 53 | } |
| | | 54 | |
| | | 55 | |
| | | 56 | return res; |
| | | 57 | } |