View Javadoc
1   package org.andromda.metafacades.uml14;
2   
3   import java.util.ArrayList;
4   import java.util.Collection;
5   import java.util.Iterator;
6   import org.omg.uml.behavioralelements.activitygraphs.ActivityGraph;
7   import org.omg.uml.behavioralelements.activitygraphs.Partition;
8   import org.omg.uml.behavioralelements.statemachines.StateVertex;
9   
10  /**
11   * MetafacadeLogic implementation for org.andromda.metafacades.uml.PartitionFacade.
12   *
13   * @see org.andromda.metafacades.uml.PartitionFacade
14   * @author Bob Fields
15   */
16  public class PartitionFacadeLogicImpl
17          extends PartitionFacadeLogic
18  {
19      private static final long serialVersionUID = 8178073921061583901L;
20      // ---------------- constructor -------------------------------
21  
22      /**
23       * @param metaObject
24       * @param context
25       */
26      public PartitionFacadeLogicImpl(Partition metaObject, String context)
27      {
28          super(metaObject, context);
29      }
30  
31      /**
32       * @see org.andromda.metafacades.uml.PartitionFacade#getActivityGraph()
33       */
34      @Override
35      protected ActivityGraph handleGetActivityGraph()
36      {
37          return metaObject.getActivityGraph();
38      }
39  
40      /**
41       * @see org.andromda.metafacades.uml14.PartitionFacadeLogic#handleGetVertices()
42       */
43      protected Collection<StateVertex> handleGetVertices()
44      {
45          Collection<StateVertex> vertices = new ArrayList<StateVertex>();
46  
47          final Collection contents = metaObject.getContents();
48          for (final Iterator contentIterator = contents.iterator(); contentIterator.hasNext();)
49          {
50              final Object element = contentIterator.next();
51              if (element instanceof StateVertex)
52              {
53                  vertices.add((StateVertex)element);
54              }
55          }
56  
57          return vertices;
58      }
59  }