Package java.util

Examples of java.util.LinkedHashMap$KeyIterator


    /**
     * Construct an empty DList.
     */
    DList() {
        map = new LinkedHashMap(4096);

    }
View Full Code Here


     */
    protected void populateTemplateContext(Map templateContext)
    {
        if (templateContext == null)
        {
            templateContext = new LinkedHashMap();
        }
        this.addTemplateObjectsToContext(templateContext);
        this.addPropertyReferencesToContext(templateContext);
    }
View Full Code Here

            "name",
            name);
        Map metafacadeNamespace = (Map)this.metafacadeNamespaces.get(namespace);
        if (metafacadeNamespace == null)
        {
            metafacadeNamespace = new LinkedHashMap();
            this.metafacadeNamespaces.put(
                namespace,
                metafacadeNamespace);
        }
        Map propertyNamespace = (Map)metafacadeNamespace.get(metafacadeName);
        if (propertyNamespace == null)
        {
            propertyNamespace = new LinkedHashMap();
            metafacadeNamespace.put(
                metafacadeName,
                propertyNamespace);
        }
        propertyNamespace.put(
View Full Code Here

        if (this.getModel() != null)
        {
            Map stereotypeMetafacades = (Map)this.metafacadesByStereotype.get(namespace);
            if (stereotypeMetafacades == null)
            {
                stereotypeMetafacades = new LinkedHashMap();
            }
            metafacades = (Collection)stereotypeMetafacades.get(stereotype);
            if (metafacades == null)
            {
                metafacades = this.createMetafacades(this.getModel().findByStereotype(stereotype));
View Full Code Here

     * 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

    /**
     * @see org.andromda.metafacades.uml.FrontEndAction#getFormFields()
     */
    protected List handleGetFormFields()
    {
        final Map formFieldMap = new LinkedHashMap();

        // - For an action that starts the use case, we need to detect all usecases forwarding to the one
        //   belonging to this action if there are any parameters in those transitions we need to have
        //   them included in this action's form
        if (this.isUseCaseStart())
        {
            final FrontEndUseCase useCase = this.getUseCase();
            if (useCase != null)
            {
                final Collection finalStates = useCase.getReferencingFinalStates();
                for (final Iterator finalStateIterator = finalStates.iterator(); finalStateIterator.hasNext();)
                {
                    final Object finalStateObject = finalStateIterator.next();

                    // we need to test for the type because a non struts-use-case final state might accidently
                    // we linking to this use-case (for example: the user temporarily wants to disable code generation
                    // for a specific use-case and is not removing the final-state to use-case link(s))
                    if (finalStateObject instanceof FrontEndFinalState)
                    {
                        final FrontEndFinalState finalState = (FrontEndFinalState)finalStateObject;
                        final Collection parameters = finalState.getInterUseCaseParameters();
                        for (final Iterator parameterIterator = parameters.iterator(); parameterIterator.hasNext();)
                        {
                            final ParameterFacade parameter = (ParameterFacade)parameterIterator.next();
                            formFieldMap.put(
                                parameter.getName(),
                                parameter);
                        }
                    }
                }
            }
        }

        // if any action encountered by the execution of the complete action-graph path emits a forward
        // containing one or more parameters they need to be included as a form field too
        final Collection actionStates = this.getActionStates();
        for (final Iterator iterator = actionStates.iterator(); iterator.hasNext();)
        {
            final FrontEndActionState actionState = (FrontEndActionState)iterator.next();
            final FrontEndForward forward = actionState.getForward();
            if (forward != null)
            {
                final Collection forwardParameters = forward.getForwardParameters();
                for (final Iterator parameterIterator = forwardParameters.iterator(); parameterIterator.hasNext();)
                {
                    final ModelElementFacade forwardParameter = (ModelElementFacade)parameterIterator.next();
                    formFieldMap.put(
                        forwardParameter.getName(),
                        forwardParameter);
                }
            }
        }

        // add page variables for all pages/final-states targetted
        // also add the fields of the target page's actions (for preloading)
        final Collection forwards = this.getActionForwards();
        for (final Iterator iterator = forwards.iterator(); iterator.hasNext();)
        {
            final FrontEndForward forward = (FrontEndForward)iterator.next();
            final StateVertexFacade target = forward.getTarget();
            if (target instanceof FrontEndView)
            {
                final FrontEndView view = (FrontEndView)target;
                final Collection viewVariables = view.getVariables();
                for (final Iterator pageVariableIterator = viewVariables.iterator(); pageVariableIterator.hasNext();)
                {
                    final ModelElementFacade facade = (ModelElementFacade)pageVariableIterator.next();
                    formFieldMap.put(
                        facade.getName(),
                        facade);
                }
                final Collection allActionParameters = view.getAllFormFields();
                for (final Iterator actionParameterIterator = allActionParameters.iterator();
                    actionParameterIterator.hasNext();)
                {
                    // - don't allow existing parameters that are tables be overwritten (since they take
                    //   precedence
                    final Object parameter = actionParameterIterator.next();
                    if (parameter instanceof FrontEndParameter)
                    {
                        FrontEndParameter variable = (FrontEndParameter)parameter;
                        final String name = variable.getName();
                        final Object existingParameter = formFieldMap.get(name);
                        if (existingParameter instanceof FrontEndParameter)
                        {
                            final FrontEndParameter existingVariable = (FrontEndParameter)existingParameter;
                            if (existingVariable != null)
                            {
                                if (existingVariable.isTable())
                                {
                                    variable = existingVariable;
                                }
                            }
                        }
                        formFieldMap.put(
                            name,
                            variable);
                    }
                }
            }
            else if (target instanceof FrontEndFinalState)
            {
                // only add these if there is no parameter recorded yet with the same name
                final Collection forwardParameters = forward.getForwardParameters();
                for (final Iterator parameterIterator = forwardParameters.iterator(); parameterIterator.hasNext();)
                {
                    final ModelElementFacade facade = (ModelElementFacade)parameterIterator.next();
                    if (!formFieldMap.containsKey(facade.getName()))
                    {
                        formFieldMap.put(
                            facade.getName(),
                            facade);
                    }
                }
            }
        }

        // we do the action parameters in the end because they are allowed to overwrite existing properties
        final Collection actionParameters = this.getParameters();
        for (final Iterator parameterIterator = actionParameters.iterator(); parameterIterator.hasNext();)
        {
            final Object parameter = parameterIterator.next();
            if (parameter instanceof FrontEndParameter)
            {
                final FrontEndParameter variable = (FrontEndParameter)parameter;
                formFieldMap.put(
                    variable.getName(),
                    variable);
            }
        }

        // - if we don't have any fields defined on this action and there are no action forwards,
        //   take the parameters from the deferred operations (since we would want to stay on the same view)
        if (formFieldMap.isEmpty() && this.getActionForwards().isEmpty())
        {
            for (final Iterator iterator = this.getDeferredOperations().iterator(); iterator.hasNext();)
            {
                final OperationFacade operation = (OperationFacade)iterator.next();
                for (final Iterator parameterIterator = operation.getArguments().iterator(); parameterIterator.hasNext();)
                {
                    final ParameterFacade parameter = (ParameterFacade)parameterIterator.next();
                    formFieldMap.put(parameter.getName(), parameter);
                }
            }
        }
        return new ArrayList(formFieldMap.values());
    }
View Full Code Here

    /**
     * @see org.andromda.metafacades.uml.FrontEndView#getVariables()
     */
    protected List handleGetVariables()
    {
        final Map variablesMap = new LinkedHashMap();
        final Collection incoming = getIncoming();
        for (final Iterator iterator = incoming.iterator(); iterator.hasNext();)
        {
            final TransitionFacade transition = (TransitionFacade)iterator.next();
            final EventFacade trigger = transition.getTrigger();
            if (trigger != null)
            {
                for (final Iterator parameterIterator = trigger.getParameters().iterator(); parameterIterator.hasNext();)
                {
                    final ModelElementFacade modelElement = (ModelElementFacade)parameterIterator.next();
                    variablesMap.put(modelElement.getName(), modelElement);
                }
            }
        }
        return new ArrayList(variablesMap.values());
    }
View Full Code Here

     */
    protected List handleGetInterUseCaseParameters()
    {
        // we don't want to list parameters with the same name to we use a hash
        // map
        final Map parameterMap = new LinkedHashMap();

        final Collection transitions = this.getIncoming();
        for (final Iterator transitionIterator = transitions.iterator(); transitionIterator.hasNext();)
        {
            final FrontEndForward forward = (FrontEndForward)transitionIterator.next();
            final List forwardParameters = forward.getForwardParameters();
            for (int i = 0; i < forwardParameters.size(); i++)
            {
                final ModelElementFacade parameter = (ModelElementFacade)forwardParameters.get(i);
                parameterMap.put(
                    parameter.getName(),
                    parameter);
            }
        }

        return new ArrayList(parameterMap.values());
    }
View Full Code Here

     * @see org.andromda.metafacades.uml.FrontEndFinalState#getInterUseCaseParameters()
     */
    protected List handleGetInterUseCaseParameters()
    {
        // we don't want to list parameters with the same name to we use a hash map
        final Map parameterMap = new LinkedHashMap();

        final Collection transitions = getIncoming();
        for (final Iterator transitionIterator = transitions.iterator(); transitionIterator.hasNext();)
        {
            final FrontEndForward forward = (FrontEndForward)transitionIterator.next();
            final List forwardParameters = forward.getForwardParameters();
            for (int i = 0; i < forwardParameters.size(); i++)
            {
                final ModelElementFacade parameter = (ModelElementFacade)forwardParameters.get(i);
                parameterMap.put(parameter.getName(), parameter);
            }
        }

        return new ArrayList(parameterMap.values());
    }
View Full Code Here

            templateContext + "'");
        if (this.getTemplate() != null)
        {
            if (templateContext == null)
            {
                templateContext = new LinkedHashMap();
            }
            this.getLibrary().populateTemplateContext(templateContext);

            try
            {
View Full Code Here

TOP

Related Classes of java.util.LinkedHashMap$KeyIterator

Copyright © 2018 www.massapicom. 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.