001package org.andromda.metafacades.uml14;
002
003import java.util.ArrayList;
004import java.util.Collection;
005import java.util.Iterator;
006import java.util.List;
007import org.andromda.metafacades.uml.FrontEndController;
008import org.andromda.metafacades.uml.FrontEndUseCase;
009import org.andromda.metafacades.uml.ModelElementFacade;
010
011/**
012 * MetafacadeLogic implementation for org.andromda.metafacades.uml.FrontEndPackage.
013 *
014 * @see org.andromda.metafacades.uml.FrontEndPackage
015 * @author Bob Fields
016 */
017public class FrontEndPackageLogicImpl
018    extends FrontEndPackageLogic
019{
020    private static final long serialVersionUID = 34L;
021    /**
022     * @param metaObject
023     * @param context
024     */
025    public FrontEndPackageLogicImpl (Object metaObject, String context)
026    {
027        super (metaObject, context);
028    }
029
030    /**
031     * @see org.andromda.metafacades.uml.FrontEndPackage#getFrontEndUseCases()
032     */
033    @Override
034    protected List<FrontEndUseCase> handleGetFrontEndUseCases()
035    {
036        final List<FrontEndUseCase> useCases = new ArrayList<FrontEndUseCase>();
037        final Collection<ModelElementFacade> ownedElements = getOwnedElements();
038        for (final Iterator<ModelElementFacade> elementIterator = ownedElements.iterator(); elementIterator.hasNext();)
039        {
040            final Object object = elementIterator.next();
041            if (object instanceof FrontEndUseCase)
042            {
043                useCases.add((FrontEndUseCase)object);
044            }
045        }
046        return useCases;
047    }
048
049    /**
050     * @see org.andromda.metafacades.uml.FrontEndPackage#getFrontEndControllers()
051     */
052    @Override
053    protected List<FrontEndController> handleGetFrontEndControllers()
054    {
055        final List<FrontEndController> useCases = new ArrayList<FrontEndController>();
056        final Collection<ModelElementFacade> ownedElements = getOwnedElements();
057        for (final Iterator<ModelElementFacade> elementIterator = ownedElements.iterator(); elementIterator.hasNext();)
058        {
059            final Object object = elementIterator.next();
060            if (object instanceof FrontEndController)
061            {
062                useCases.add((FrontEndController)object);
063            }
064        }
065        return useCases;
066    }
067
068}