View Javadoc
1   package org.andromda.metafacades.emf.uml22;
2   
3   import java.lang.reflect.InvocationTargetException;
4   import java.util.Map;
5   import org.eclipse.emf.common.notify.Adapter;
6   import org.eclipse.emf.common.notify.Notification;
7   import org.eclipse.emf.common.util.DiagnosticChain;
8   import org.eclipse.emf.common.util.EList;
9   import org.eclipse.emf.common.util.TreeIterator;
10  import org.eclipse.emf.ecore.EAnnotation;
11  import org.eclipse.emf.ecore.EClass;
12  import org.eclipse.emf.ecore.EObject;
13  import org.eclipse.emf.ecore.EOperation;
14  import org.eclipse.emf.ecore.EReference;
15  import org.eclipse.emf.ecore.EStructuralFeature;
16  import org.eclipse.emf.ecore.resource.Resource;
17  import org.eclipse.uml2.uml.Comment;
18  import org.eclipse.uml2.uml.DirectedRelationship;
19  import org.eclipse.uml2.uml.Element;
20  import org.eclipse.uml2.uml.InstanceSpecification;
21  import org.eclipse.uml2.uml.Model;
22  import org.eclipse.uml2.uml.Package;
23  import org.eclipse.uml2.uml.Relationship;
24  import org.eclipse.uml2.uml.Slot;
25  import org.eclipse.uml2.uml.Stereotype;
26  import org.eclipse.uml2.uml.StructuralFeature;
27  import org.eclipse.uml2.uml.Type;
28  import org.eclipse.uml2.uml.ValueSpecification;
29  
30  /**
31   *
32   */
33  public class LinkEndImpl implements LinkEnd
34  {
35      /**
36       *
37       */
38      final Slot slot;
39  
40      /**
41       * @param slotIn
42       */
43      LinkEndImpl(final Slot slotIn)
44      {
45          this.slot = slotIn;
46      }
47  
48      /**
49       * @see Object#equals(Object)
50       */
51      @Override
52      public boolean equals(final Object object)
53      {
54          /*if (object instanceof AttributeLinkImpl)
55          {
56              return this.slot.equals(((AttributeLinkImpl)object).slot);
57          }*/
58          if (object instanceof LinkEndImpl)
59          {
60              return this.slot.equals(((LinkEndImpl)object).slot);
61          }
62          return this.slot.equals(object);
63      }
64  
65      /**
66       * @see Object#hashCode()
67       */
68      @Override
69      public int hashCode()
70      {
71          return this.slot.hashCode();
72      }
73  
74      /**
75       * @see Object#toString()
76       */
77      @Override
78      public String toString()
79      {
80          return this.getClass().getName() + '[' + this.slot.toString() + ']';
81      }
82  
83      /**
84       * @see org.eclipse.uml2.uml.Slot#getOwningInstance()
85       */
86      public InstanceSpecification getOwningInstance()
87      {
88          return this.slot.getOwningInstance();
89      }
90  
91      /**
92       * @see org.eclipse.uml2.uml.Slot#setOwningInstance(org.eclipse.uml2.uml.InstanceSpecification)
93       */
94      public void setOwningInstance(final InstanceSpecification instanceSpecification)
95      {
96          this.slot.setOwningInstance(instanceSpecification);
97      }
98  
99      /**
100      * @see org.eclipse.uml2.uml.Slot#getValues()
101      */
102     public EList<ValueSpecification> getValues()
103     {
104         return this.slot.getValues();
105     }
106 
107     /**
108      * @param string
109      * @return slot.getValue(string, null)
110      */
111     public ValueSpecification getValue(final String string)
112     {
113         return this.slot.getValue(string, null);
114     }
115 
116     /**
117      * @see org.eclipse.uml2.uml.Slot#getValue(String, org.eclipse.uml2.uml.Type)
118      */
119     public ValueSpecification getValue(final String string, final Type type)
120     {
121         return this.slot.getValue(string, type);
122     }
123 
124     /**
125      * @see org.eclipse.uml2.uml.Slot#getValue(String, org.eclipse.uml2.uml.Type, boolean, org.eclipse.emf.ecore.EClass, boolean)
126      */
127     public ValueSpecification getValue(final String name, final Type type, final boolean ignoreCase, final EClass eClass, final boolean createOnDemand)
128     {
129         return this.slot.getValue(name, type, ignoreCase, eClass, createOnDemand);
130     }
131 
132     /**
133      * @param eClass
134      * @return slot.createValue(null, null, eClass)
135      */
136     public ValueSpecification createValue(final EClass eClass)
137     {
138         return this.slot.createValue(null, null, eClass);
139     }
140 
141     /**
142      * @see org.eclipse.uml2.uml.Slot#createValue(String, org.eclipse.uml2.uml.Type, org.eclipse.emf.ecore.EClass)
143      */
144     public ValueSpecification createValue(final String name, final Type type, final EClass eClass)
145     {
146         return this.slot.createValue(name, type, eClass);
147     }
148 
149     /**
150      * @see org.eclipse.uml2.uml.Slot#getDefiningFeature()
151      */
152     public StructuralFeature getDefiningFeature()
153     {
154         return this.slot.getDefiningFeature();
155     }
156 
157     /**
158      * @see org.eclipse.uml2.uml.Slot#setDefiningFeature(org.eclipse.uml2.uml.StructuralFeature)
159      */
160     public void setDefiningFeature(final StructuralFeature structuralFeature)
161     {
162         this.slot.setDefiningFeature(structuralFeature);
163     }
164 
165     /**
166      * @see org.eclipse.emf.ecore.EObject#eGet(org.eclipse.emf.ecore.EStructuralFeature, boolean)
167      */
168     public Object eGet(final EStructuralFeature eStructuralFeature, final boolean resolve)
169     {
170         return this.slot.eGet(eStructuralFeature, resolve);
171     }
172 
173     /**
174      * @see org.eclipse.emf.ecore.EObject#eSet(org.eclipse.emf.ecore.EStructuralFeature, Object)
175      */
176     public void eSet(final EStructuralFeature eStructuralFeature, final Object object)
177     {
178         this.slot.eSet(eStructuralFeature, object);
179     }
180 
181     /**
182      * @see org.eclipse.emf.ecore.EObject#eUnset(org.eclipse.emf.ecore.EStructuralFeature)
183      */
184     public void eUnset(final EStructuralFeature eStructuralFeature)
185     {
186         this.slot.eUnset(eStructuralFeature);
187     }
188 
189     /**
190      * @see org.eclipse.emf.ecore.EObject#eIsSet(org.eclipse.emf.ecore.EStructuralFeature)
191      */
192     public boolean eIsSet(final EStructuralFeature eStructuralFeature)
193     {
194         return this.slot.eIsSet(eStructuralFeature);
195     }
196 
197     /**
198      * @see org.eclipse.uml2.uml.Element#getOwnedElements()
199      */
200     public EList<Element> getOwnedElements()
201     {
202         return this.slot.getOwnedElements();
203     }
204 
205     /**
206      * @see org.eclipse.uml2.uml.Element#getOwner()
207      */
208     public Element getOwner()
209     {
210         return this.slot.getOwner();
211     }
212 
213     /**
214      * @see org.eclipse.uml2.uml.Element#getOwnedComments()
215      */
216     public EList<Comment> getOwnedComments()
217     {
218         return this.slot.getOwnedComments();
219     }
220 
221     /**
222      * @param eClass
223      * @return slot.createOwnedComment()
224      */
225     public Comment createOwnedComment(final EClass eClass)
226     {
227         return this.slot.createOwnedComment();
228     }
229 
230     /**
231      * @see org.eclipse.uml2.uml.Element#createOwnedComment()
232      */
233     public Comment createOwnedComment()
234     {
235         return this.slot.createOwnedComment();
236     }
237 
238     /**
239      * @see org.eclipse.uml2.uml.Element#validateHasOwner(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map)
240      */
241     public boolean validateHasOwner(final DiagnosticChain diagnosticChain, final Map<Object, Object> context)
242     {
243         return this.slot.validateHasOwner(diagnosticChain, context);
244     }
245 
246     /**
247      * @see org.eclipse.uml2.uml.Element#validateNotOwnSelf(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map)
248      */
249     public boolean validateNotOwnSelf(final DiagnosticChain diagnosticChain, final Map<Object, Object> context)
250     {
251         return this.slot.validateNotOwnSelf(diagnosticChain, context);
252     }
253 
254     /**
255      * @see org.eclipse.uml2.uml.Element#allOwnedElements()
256      */
257     public EList<Element> allOwnedElements()
258     {
259         return this.slot.allOwnedElements();
260     }
261 
262     /**
263      * @see org.eclipse.uml2.uml.Element#mustBeOwned()
264      */
265     public boolean mustBeOwned()
266     {
267         return this.slot.mustBeOwned();
268     }
269 
270     /**
271      * @see org.eclipse.uml2.uml.Element#createEAnnotation(String)
272      */
273     public EAnnotation createEAnnotation(final String string)
274     {
275         return this.slot.createEAnnotation(string);
276     }
277 
278     /**
279      * @param stereotype
280      */
281     public void apply(final Stereotype stereotype)
282     {
283         this.slot.applyStereotype(stereotype);
284     }
285 
286     /**
287      * @see org.eclipse.uml2.uml.Element#applyStereotype(org.eclipse.uml2.uml.Stereotype)
288      */
289     public EObject applyStereotype(final Stereotype stereotype)
290     {
291         return this.slot.applyStereotype(stereotype);
292     }
293 
294     /**
295      * @see org.eclipse.uml2.uml.Element#getApplicableStereotype(String)
296      */
297     public Stereotype getApplicableStereotype(final String string)
298     {
299         return this.slot.getApplicableStereotype(string);
300     }
301 
302     /**
303      * @see org.eclipse.uml2.uml.Element#getApplicableStereotypes()
304      */
305     public EList<Stereotype> getApplicableStereotypes()
306     {
307         return this.slot.getApplicableStereotypes();
308     }
309 
310     /**
311      * @see org.eclipse.uml2.uml.Element#getAppliedStereotype(String)
312      */
313     public Stereotype getAppliedStereotype(final String string)
314     {
315         return this.slot.getAppliedStereotype(string);
316     }
317 
318     /**
319      * @see org.eclipse.uml2.uml.Element#getAppliedSubstereotype(org.eclipse.uml2.uml.Stereotype, String)
320      */
321     public Stereotype getAppliedSubstereotype(final Stereotype stereotype, final String string)
322     {
323         return this.slot.getAppliedSubstereotype(stereotype, string);
324     }
325 
326     /**
327      * @see org.eclipse.uml2.uml.Element#getAppliedStereotypes()
328      */
329     public EList<Stereotype> getAppliedStereotypes()
330     {
331         return this.slot.getAppliedStereotypes();
332     }
333 
334     /**
335      * @see org.eclipse.uml2.uml.Element#getAppliedSubstereotypes(org.eclipse.uml2.uml.Stereotype)
336      */
337     public EList<Stereotype> getAppliedSubstereotypes(final Stereotype stereotype)
338     {
339         return this.slot.getAppliedSubstereotypes(stereotype);
340     }
341 
342     /**
343      * @see org.eclipse.uml2.uml.Element#getModel()
344      */
345     public Model getModel()
346     {
347         return (Model) UmlUtilities.findModel(this.slot);
348     }
349 
350     /**
351      * @see org.eclipse.uml2.uml.Element#getNearestPackage()
352      */
353     public Package getNearestPackage()
354     {
355         return this.slot.getNearestPackage();
356     }
357 
358     /**
359      * @see org.eclipse.uml2.uml.Element#getValue(org.eclipse.uml2.uml.Stereotype, String)
360      */
361     public Object getValue(final Stereotype stereotype, final String string)
362     {
363         return this.slot.getValue(stereotype, string);
364     }
365 
366     /**
367      * @see org.eclipse.uml2.uml.Element#isStereotypeApplicable(org.eclipse.uml2.uml.Stereotype)
368      */
369     public boolean isStereotypeApplicable(final Stereotype stereotype)
370     {
371         return this.slot.isStereotypeApplicable(stereotype);
372     }
373 
374     /**
375      * @param stereotype
376      * @return slot.isStereotypeApplied(stereotype)
377      */
378     public boolean isApplied(final Stereotype stereotype)
379     {
380         return this.slot.isStereotypeApplied(stereotype);
381     }
382 
383     /**
384      * @see org.eclipse.uml2.uml.Element#isStereotypeApplied(org.eclipse.uml2.uml.Stereotype)
385      */
386     public boolean isStereotypeApplied(final Stereotype stereotype)
387     {
388         return this.slot.isStereotypeApplied(stereotype);
389     }
390 
391     /**
392      * @param stereotype
393      * @return slot.isStereotypeRequired(stereotype)
394      */
395     public boolean isRequired(final Stereotype stereotype)
396     {
397         return this.slot.isStereotypeRequired(stereotype);
398     }
399 
400     /**
401      * @see org.eclipse.uml2.uml.Element#isStereotypeRequired(org.eclipse.uml2.uml.Stereotype)
402      */
403     public boolean isStereotypeRequired(final Stereotype stereotype)
404     {
405         return this.slot.isStereotypeRequired(stereotype);
406     }
407 
408     /**
409      * @see org.eclipse.uml2.uml.Element#setValue(org.eclipse.uml2.uml.Stereotype, String, Object)
410      */
411     public void setValue(final Stereotype stereotype, final String string, final Object object)
412     {
413         this.slot.setValue(stereotype, string, object);
414     }
415 
416     /**
417      * @see org.eclipse.uml2.uml.Element#hasValue(org.eclipse.uml2.uml.Stereotype, String)
418      */
419     public boolean hasValue(final Stereotype stereotype, final String string)
420     {
421         return this.slot.hasValue(stereotype, string);
422     }
423 
424     /*public void unapply(Stereotype stereotype)
425     {
426         this.slot.unapply(stereotype);
427     }*/
428 
429     /**
430      * @see org.eclipse.uml2.uml.Element#unapplyStereotype(org.eclipse.uml2.uml.Stereotype)
431      */
432     public EObject unapplyStereotype(final Stereotype stereotype)
433     {
434         return this.slot.unapplyStereotype(stereotype);
435     }
436 
437     /**
438      * @see org.eclipse.uml2.uml.Element#destroy()
439      */
440     public void destroy()
441     {
442         this.slot.destroy();
443     }
444 
445     /*public String getAppliedVersion(Stereotype stereotype)
446     {
447         return this.slot.getAppliedVersion(stereotype);
448     }*/
449 
450     /**
451      * @see org.eclipse.uml2.uml.Element#addKeyword(String)
452      */
453     public boolean addKeyword(final String string)
454     {
455         return this.slot.addKeyword(string);
456     }
457 
458     /**
459      * @see org.eclipse.uml2.uml.Element#getKeywords()
460      */
461     public EList<String> getKeywords()
462     {
463         return this.slot.getKeywords();
464     }
465 
466     /**
467      * @see org.eclipse.uml2.uml.Element#hasKeyword(String)
468      */
469     public boolean hasKeyword(final String string)
470     {
471         return this.slot.hasKeyword(string);
472     }
473 
474     /**
475      * @see org.eclipse.uml2.uml.Element#removeKeyword(String)
476      */
477     public boolean removeKeyword(final String string)
478     {
479         return this.slot.removeKeyword(string);
480     }
481 
482     /**
483      * @see org.eclipse.emf.ecore.EModelElement#getEAnnotations()
484      */
485     public EList<EAnnotation> getEAnnotations()
486     {
487         return this.slot.getEAnnotations();
488     }
489 
490     /**
491      * @see org.eclipse.emf.ecore.EModelElement#getEAnnotation(String)
492      */
493     public EAnnotation getEAnnotation(final String string)
494     {
495         return this.slot.getEAnnotation(string);
496     }
497 
498     /**
499      * @see org.eclipse.emf.common.notify.Notifier#eAdapters()
500      */
501     public EList<Adapter> eAdapters()
502     {
503         return this.slot.eAdapters();
504     }
505 
506     /**
507      * @see org.eclipse.emf.common.notify.Notifier#eDeliver()
508      */
509     public boolean eDeliver()
510     {
511         return this.slot.eDeliver();
512     }
513 
514     /**
515      * @see org.eclipse.emf.common.notify.Notifier#eSetDeliver(boolean)
516      */
517     public void eSetDeliver(final boolean deliver)
518     {
519         this.slot.eSetDeliver(deliver);
520     }
521 
522     /**
523      * @see org.eclipse.emf.ecore.EObject#eIsProxy()
524      */
525     public boolean eIsProxy()
526     {
527         return this.slot.eIsProxy();
528     }
529 
530     /**
531      * @see org.eclipse.emf.ecore.EObject#eClass()
532      */
533     public EClass eClass()
534     {
535         return this.slot.eClass();
536     }
537 
538     /**
539      * @see org.eclipse.emf.ecore.EObject#eContainer()
540      */
541     public EObject eContainer()
542     {
543         return this.slot.eContainer();
544     }
545 
546     /**
547      * @see org.eclipse.emf.ecore.EObject#eContents()
548      */
549     public EList<EObject> eContents()
550     {
551         return this.slot.eContents();
552     }
553 
554     /**
555      * @see org.eclipse.emf.ecore.EObject#eCrossReferences()
556      */
557     public EList<EObject> eCrossReferences()
558     {
559         return this.slot.eCrossReferences();
560     }
561 
562     /**
563      * @see org.eclipse.emf.ecore.EObject#eAllContents()
564      */
565     public TreeIterator<EObject> eAllContents()
566     {
567         return this.slot.eAllContents();
568     }
569 
570     /**
571      * @see org.eclipse.emf.ecore.EObject#eContainmentFeature()
572      */
573     public EReference eContainmentFeature()
574     {
575         return this.slot.eContainmentFeature();
576     }
577 
578     /**
579      * @see org.eclipse.emf.ecore.EObject#eContainingFeature()
580      */
581     public EStructuralFeature eContainingFeature()
582     {
583         return this.slot.eContainingFeature();
584     }
585 
586     /**
587      * @see org.eclipse.emf.ecore.EObject#eResource()
588      */
589     public Resource eResource()
590     {
591         return this.slot.eResource();
592     }
593 
594     /**
595      * @see org.eclipse.emf.ecore.EObject#eGet(org.eclipse.emf.ecore.EStructuralFeature)
596      */
597     public Object eGet(final EStructuralFeature eStructuralFeature)
598     {
599         return this.slot.eGet(eStructuralFeature);
600     }
601 
602     /**
603      * @see org.eclipse.emf.common.notify.Notifier#eNotify(org.eclipse.emf.common.notify.Notification)
604      */
605     public void eNotify(final Notification notification)
606     {
607         this.slot.eNotify(notification);
608     }
609 
610     /**
611      * @see org.eclipse.uml2.uml.Element#getRelationships()
612      */
613     public EList<Relationship> getRelationships()
614     {
615         return this.slot.getRelationships();
616     }
617 
618     /**
619      * @see org.eclipse.uml2.uml.Element#getRelationships(org.eclipse.emf.ecore.EClass)
620      */
621     public EList<Relationship> getRelationships(final EClass eClass)
622     {
623         return this.slot.getRelationships(eClass);
624     }
625 
626     /**
627      * @see org.eclipse.uml2.uml.Element#getRequiredStereotype(String)
628      */
629     public Stereotype getRequiredStereotype(final String qualifiedName)
630     {
631         return this.slot.getRequiredStereotype(qualifiedName);
632     }
633 
634     /**
635      * @see org.eclipse.uml2.uml.Element#getRequiredStereotypes()
636      */
637     public EList<Stereotype> getRequiredStereotypes()
638     {
639         return this.slot.getRequiredStereotypes();
640     }
641 
642     /**
643      * @see org.eclipse.uml2.uml.Element#getSourceDirectedRelationships()
644      */
645     public EList<DirectedRelationship> getSourceDirectedRelationships()
646     {
647         return this.slot.getSourceDirectedRelationships();
648     }
649 
650     /**
651      * @see org.eclipse.uml2.uml.Element#getSourceDirectedRelationships(org.eclipse.emf.ecore.EClass)
652      */
653     public EList<DirectedRelationship> getSourceDirectedRelationships(final EClass eClass)
654     {
655         return this.slot.getSourceDirectedRelationships(eClass);
656     }
657 
658     /**
659      * @see org.eclipse.uml2.uml.Element#getStereotypeApplication(org.eclipse.uml2.uml.Stereotype)
660      */
661     public EObject getStereotypeApplication(final Stereotype stereotype)
662     {
663         return this.slot.getStereotypeApplication(stereotype);
664     }
665 
666     /**
667      * @see org.eclipse.uml2.uml.Element#getStereotypeApplications()
668      */
669     public EList<EObject> getStereotypeApplications()
670     {
671         return this.slot.getStereotypeApplications();
672     }
673 
674     /**
675      * @see org.eclipse.uml2.uml.Element#getTargetDirectedRelationships()
676      */
677     public EList<DirectedRelationship> getTargetDirectedRelationships()
678     {
679         return this.slot.getTargetDirectedRelationships();
680     }
681 
682     /**
683      * @see org.eclipse.uml2.uml.Element#getTargetDirectedRelationships(org.eclipse.emf.ecore.EClass)
684      */
685     public EList<DirectedRelationship> getTargetDirectedRelationships(final EClass eClass)
686     {
687         return this.slot.getTargetDirectedRelationships(eClass);
688     }
689 
690     /**
691      * UML2 3.1 (Eclipse 3.6) only
692      * @see org.eclipse.emf.ecore.EObject#eInvoke(org.eclipse.emf.ecore.EOperation, org.eclipse.emf.common.util.EList)
693      */
694     public Object eInvoke(final EOperation operation, final EList<?> arguments) throws InvocationTargetException
695     {
696         return this.slot.eInvoke(operation, arguments);
697     }
698 }