View Javadoc
1   package org.andromda.metafacades.emf.uml22;
2   
3   import java.util.ArrayList;
4   import java.util.Collection;
5   import java.util.Iterator;
6   import java.util.List;
7   import org.andromda.metafacades.uml.FrontEndController;
8   import org.andromda.metafacades.uml.FrontEndUseCase;
9   import org.andromda.metafacades.uml.ModelElementFacade;
10  
11  /**
12   * MetafacadeLogic implementation for
13   * org.andromda.metafacades.uml.FrontEndPackage.
14   *
15   * @see org.andromda.metafacades.uml.FrontEndPackage
16   */
17  public class FrontEndPackageLogicImpl
18      extends FrontEndPackageLogic
19  {
20      private static final long serialVersionUID = 34L;
21      /**
22       * @param metaObject
23       * @param context
24       */
25      public FrontEndPackageLogicImpl(
26          final Object metaObject,
27          final String context)
28      {
29          super(metaObject, context);
30      }
31  
32      /**
33       * @see org.andromda.metafacades.uml.FrontEndPackage#getFrontEndUseCases()
34       */
35      @Override
36      protected List<FrontEndUseCase> handleGetFrontEndUseCases()
37      {
38          final List<FrontEndUseCase> useCases = new ArrayList<FrontEndUseCase>();
39          final Collection<ModelElementFacade> ownedElements = this.getOwnedElements();
40          for (final Iterator<ModelElementFacade> elementIterator = ownedElements.iterator(); elementIterator.hasNext();)
41          {
42              final Object object = elementIterator.next();
43              if (object instanceof FrontEndUseCase)
44              {
45                  useCases.add((FrontEndUseCase)object);
46              }
47          }
48          return useCases;
49      }
50  
51      /**
52       * @see org.andromda.metafacades.uml.FrontEndPackage#getFrontEndControllers()
53       */
54      @Override
55      protected List<FrontEndController> handleGetFrontEndControllers()
56      {
57          final List<FrontEndController> useCases = new ArrayList<FrontEndController>();
58          final Collection<ModelElementFacade> ownedElements = this.getOwnedElements();
59          for (final Iterator<ModelElementFacade> elementIterator = ownedElements.iterator(); elementIterator.hasNext();)
60          {
61              final Object object = elementIterator.next();
62              if (object instanceof FrontEndController)
63              {
64                  useCases.add((FrontEndController)object);
65              }
66          }
67          return useCases;
68      }
69  }