Examples of LinkedHashSet


Examples of java.util.LinkedHashSet

    {
        final StringBuffer buffer = new StringBuffer();
        String separator = "";
        buffer.append("(");

        final Set attributes = new LinkedHashSet(this.getAttributes());

        for (ClassifierFacade superClass = (ClassifierFacade)this.getGeneralization(); superClass != null && follow;
            superClass = (ClassifierFacade)superClass.getGeneralization())
        {
            if (superClass instanceof Entity)
            {
                final Entity entity = (Entity)superClass;
                attributes.addAll(entity.getAttributes());
            }
        }

        if (!attributes.isEmpty())
        {
            for (final Iterator iterator = attributes.iterator(); iterator.hasNext();)
            {
                final EntityAttribute attribute = (EntityAttribute)iterator.next();
                if (withIdentifiers || !attribute.isIdentifier())
                {
                    buffer.append(separator);
View Full Code Here

Examples of java.util.LinkedHashSet

     */
    protected Collection handleGetRequiredProperties(
        final boolean follow,
        final boolean withIdentifiers)
    {
        final Set properties = new LinkedHashSet(this.getProperties(
                    follow,
                    withIdentifiers));
        CollectionUtils.filter(
            properties,
            new Predicate()
View Full Code Here

Examples of java.util.LinkedHashSet

    /**
     * @see org.andromda.metafacades.uml.EntityLogic#getAllEntityReferences()
     */
    protected Collection handleGetAllEntityReferences()
    {
        final Collection result = new LinkedHashSet();

        // get references of the service itself
        result.addAll(this.getEntityReferences());

        // get references of all super classes
        CollectionUtils.forAllDo(this.getAllGeneralizations(), new Closure()
        {
            public void execute(Object object)
            {
                if (object instanceof Entity)
                {
                    final Entity entity = (Entity)object;
                    result.addAll(entity.getEntityReferences());
                }
            }

        });
        return result;
View Full Code Here

Examples of java.util.LinkedHashSet

     * transitions in one shot, so that they can be queried more effiencently
     * later on.
     */
    private void initializeCollections()
    {
        this.actionStates = new LinkedHashSet();
        this.collectTransitions(
            this,
            new LinkedHashSet());
    }
View Full Code Here

Examples of java.util.LinkedHashSet

    /**
     * @see org.andromda.metafacades.uml.FrontEndAction#getActions()
     */
    protected java.util.List handleGetActions()
    {
        final Set actions = new LinkedHashSet();
        this.findActions(
            actions,
            new LinkedHashSet());
        return new ArrayList(actions);
    }
View Full Code Here

Examples of java.util.LinkedHashSet

    /**
     * @see org.andromda.metafacades.uml.FrontEndAction#getDeferredOperations()
     */
    protected java.util.List handleGetDeferredOperations()
    {
        final Collection deferredOperations = new LinkedHashSet();
        final FrontEndController controller = this.getController();
        if (controller != null)
        {
            final List actionStates = this.getActionStates();
            for (int ctr = 0; ctr < actionStates.size(); ctr++)
            {
                final FrontEndActionState actionState = (FrontEndActionState)actionStates.get(ctr);
                deferredOperations.addAll(actionState.getControllerCalls());
            }

            final List transitions = this.getDecisionTransitions();
            for (int ctr = 0; ctr < transitions.size(); ctr++)
            {
                final FrontEndForward forward = (FrontEndForward)transitions.get(ctr);
                final FrontEndEvent trigger = forward.getDecisionTrigger();
                if (trigger != null)
                {
                    deferredOperations.add(trigger.getControllerCall());
                }
            }
        }
        return new ArrayList(deferredOperations);
    }
View Full Code Here

Examples of java.util.LinkedHashSet

    /**
     * @see org.andromda.metafacades.uml.FrontEndAction#getTargetViews()
     */
    protected List handleGetTargetViews()
    {
        final Collection targetViews = new LinkedHashSet();
        final Collection forwards = this.getActionForwards();
        for (final Iterator iterator = forwards.iterator(); iterator.hasNext();)
        {
            final FrontEndForward forward = (FrontEndForward)iterator.next();
            if (forward.isEnteringView())
            {
                targetViews.add(forward.getTarget());
            }
        }
        return new ArrayList(targetViews);
    }
View Full Code Here

Examples of java.util.LinkedHashSet

     * Initializes all action states, action forwards, decision transitions and transitions in one shot, so that they
     * can be queried more effiencently later on.
     */
    private void initializeCollections()
    {
        this.actionStates = new LinkedHashSet();
        this.actionForwards = new LinkedHashMap();
        this.decisionTransitions = new LinkedHashSet();
        this.transitions = new LinkedHashSet();
        this.collectTransitions(
            (TransitionFacade)this.THIS(),
            transitions);
    }
View Full Code Here

Examples of java.util.LinkedHashSet

    private Collection filter(
        Collection collection,
        Predicate collectionFilter)
    {
        final Set filteredCollection = new LinkedHashSet();
        for (final Iterator iterator = collection.iterator(); iterator.hasNext();)
        {
            final Object object = iterator.next();
            if (collectionFilter.evaluate(object))
            {
                filteredCollection.add(object);
            }
        }
        return filteredCollection;
    }
View Full Code Here

Examples of java.util.LinkedHashSet

    /**
     * @see org.andromda.metafacades.uml.ServiceOperation#getRoles()
     */
    public java.util.Collection handleGetRoles()
    {
        final Collection roles = new LinkedHashSet();
        if (this.getOwner() instanceof Service)
        {
            roles.addAll(((Service)this.getOwner()).getRoles());
        }
        final Collection operationRoles = new ArrayList(this.getTargetDependencies());
        CollectionUtils.filter(
            operationRoles,
            new Predicate()
            {
                public boolean evaluate(Object object)
                {
                    DependencyFacade dependency = (DependencyFacade)object;
                    return dependency != null && dependency.getSourceElement() != null &&
                    Role.class.isAssignableFrom(dependency.getSourceElement().getClass());
                }
            });
        CollectionUtils.transform(
            operationRoles,
            new Transformer()
            {
                public Object transform(Object object)
                {
                    return ((DependencyFacade)object).getSourceElement();
                }
            });
        roles.addAll(operationRoles);
        final Collection allRoles = new LinkedHashSet(roles);

        // add all roles which are specializations of this one
        CollectionUtils.forAllDo(
            roles,
            new Closure()
            {
                public void execute(Object object)
                {
                    if (object instanceof Role)
                    {
                        allRoles.addAll(((Role)object).getAllSpecializations());
                    }
                }
            });
        return allRoles;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.