Package java.util

Examples of java.util.LinkedHashSet$MyIterator


    /**
     * @see org.andromda.cartridges.bpm4struts.metafacades.StrutsAction#getTargetPages()
     */
    protected List handleGetTargetPages()
    {
        Collection targetPages = new LinkedHashSet();

        Collection forwards = getActionForwards();
        for (final Iterator forwardIterator = forwards.iterator(); forwardIterator.hasNext();)
        {
            StrutsForward forward = (StrutsForward) forwardIterator.next();
            if (forward.isEnteringPage())
            {
                targetPages.add(forward.getTarget());
            }
        }

        return new ArrayList(targetPages);
    }
View Full Code Here


    /**
     * @see org.andromda.metafacades.uml.Role#isReferencesPresent()
     */
    protected boolean handleIsReferencesPresent()
    {
        final Collection allSourceDependencies = new LinkedHashSet(this.getSourceDependencies());
        for (
            GeneralizableElementFacade parent = this.getGeneralization(); parent != null;
            parent = parent.getGeneralization())
        {
            allSourceDependencies.addAll(parent.getSourceDependencies());
        }
        boolean present =
            CollectionUtils.find(
                allSourceDependencies,
                new Predicate()
View Full Code Here

    /**
     * @see org.andromda.metafacades.uml.FrontEndController#getDeferringActions()
     */
    protected List handleGetDeferringActions()
    {
        final Collection deferringActions = new LinkedHashSet();

        final Collection operations = getOperations();
        for (final Iterator operationIterator = operations.iterator(); operationIterator.hasNext();)
        {
            final FrontEndControllerOperation operation = (FrontEndControllerOperation)operationIterator.next();
            deferringActions.addAll(operation.getDeferringActions());
        }
        return new ArrayList(deferringActions);
    }
View Full Code Here

    /**
     * @see org.andromda.metafacades.uml.OperationFacade#getExceptions()
     */
    protected Collection handleGetExceptions()
    {
        Collection exceptions = new LinkedHashSet();

        // finds both exceptions and exception references
        final class ExceptionFilter
                implements Predicate
        {
            public boolean evaluate(Object object)
            {
                boolean hasException = object instanceof DependencyFacade;
                if (hasException)
                {
                    DependencyFacade dependency = (DependencyFacade)object;
                    // first check for exception references
                    hasException = dependency.hasStereotype(UMLProfile.STEREOTYPE_EXCEPTION_REF);

                    // if there wasn't any exception reference
                    // now check for actual exceptions
                    if (!hasException)
                    {
                        ModelElementFacade targetElement = dependency.getTargetElement();
                        hasException = targetElement != null && targetElement.hasStereotype(
                                UMLProfile.STEREOTYPE_EXCEPTION);
                    }
                }
                return hasException;
            }
        }

        // first get any dependencies on this operation's
        // owner (because these will represent the default exception(s))
        final Collection ownerDependencies = new ArrayList(this.getOwner().getSourceDependencies());
        if (ownerDependencies != null && !ownerDependencies.isEmpty())
        {
            CollectionUtils.filter(ownerDependencies, new ExceptionFilter());
            exceptions.addAll(ownerDependencies);
        }

        final Collection operationDependencies = new ArrayList(this.getSourceDependencies());
        // now get any exceptions directly on the operation
        if (operationDependencies != null && !operationDependencies.isEmpty())
        {
            CollectionUtils.filter(operationDependencies, new ExceptionFilter());
            exceptions.addAll(operationDependencies);
        }

        // now transform the dependency(s) to the actual exception(s)
        CollectionUtils.transform(exceptions, new Transformer()
        {
            public Object transform(Object object)
            {
                return ((DependencyFacade)object).getTargetElement();
            }
        });
       
        // finally add in any members of the UML2 RaisedException list
        // (the 'proper' UML2 way of doing exceptions .. or at least one way).
        Collection raisedExceptions = this.metaObject.getRaisedExceptions();
        exceptions.addAll(this.shieldedElements(raisedExceptions));

        return exceptions;
    }
View Full Code Here

    /**
     * @see org.andromda.metafacades.uml.FrontEndActionState#getExceptions()
     */
    protected List handleGetExceptions()
    {
        final Set exceptions = new LinkedHashSet();
        final Collection outgoing = getOutgoing();
        for (final Iterator iterator = outgoing.iterator(); iterator.hasNext();)
        {
            final TransitionFacade transition = (TransitionFacade)iterator.next();
            if (transition instanceof FrontEndExceptionHandler)
            {
                exceptions.add(transition);
            }
        }
        return new ArrayList(exceptions);
    }
View Full Code Here

    /**
     * @see org.andromda.metafacades.uml.FrontEndActionState#getContainerActions()
     */
    protected List handleGetContainerActions()
    {
        final Collection actionSet = new LinkedHashSet();

        final StateMachineFacade stateMachineFacade = this.getStateMachine();
        if (stateMachineFacade instanceof ActivityGraphFacade)
        {
            final ActivityGraphFacade activityGraph = (ActivityGraphFacade)stateMachineFacade;
            final UseCaseFacade useCase = activityGraph.getUseCase();

            if (useCase instanceof FrontEndUseCase)
            {
                final Collection actions = ((FrontEndUseCase)useCase).getActions();
                for (final Iterator actionIterator = actions.iterator(); actionIterator.hasNext();)
                {
                    final FrontEndAction action = (FrontEndAction)actionIterator.next();
                    if (action.getActionStates().contains(this))
                    {
                        actionSet.add(action);
                    }
                }
            }
        }
        return new ArrayList(actionSet);
View Full Code Here

    /**
     * @see org.andromda.metafacades.uml.FrontEndActionState#getExceptions()
     */
    protected List handleGetExceptions()
    {
        final Set exceptions = new LinkedHashSet();
        final Collection outgoing = this.getOutgoing();
        for (final Iterator iterator = outgoing.iterator(); iterator.hasNext();)
        {
            final TransitionFacade transition = (TransitionFacade)iterator
                    .next();
            if (transition instanceof FrontEndExceptionHandler)
            {
                exceptions.add(transition);
            }
        }
        return new ArrayList(exceptions);
    }
View Full Code Here

    /**
     * @see org.andromda.metafacades.uml.FrontEndActionState#getContainerActions()
     */
    protected List handleGetContainerActions()
    {
        final Collection actionSet = new LinkedHashSet();

        final StateMachineFacade stateMachineFacade = this.getStateMachine();
        if (stateMachineFacade instanceof ActivityGraphFacade)
        {
            final ActivityGraphFacade activityGraph = (ActivityGraphFacade)stateMachineFacade;
            final UseCaseFacade useCase = activityGraph.getUseCase();

            if (useCase instanceof FrontEndUseCase)
            {
                final Collection actions = ((FrontEndUseCase)useCase)
                        .getActions();
                for (final Iterator actionIterator = actions.iterator(); actionIterator
                        .hasNext();)
                {
                    final FrontEndAction action = (FrontEndAction)actionIterator
                            .next();
                    if (action.getActionStates().contains(this))
                    {
                        actionSet.add(action);
                    }
                }
            }
        }
        return new ArrayList(actionSet);
View Full Code Here

    /**
     * @see org.andromda.metafacades.uml.OperationFacade#getExceptions()
     */
    protected Collection handleGetExceptions()
    {
        Collection exceptions = new LinkedHashSet();

        // finds both exceptions and exception references
        final class ExceptionFilter
                implements Predicate
        {
            public boolean evaluate(Object object)
            {
                boolean hasException = object instanceof DependencyFacade;
                if (hasException)
                {
                    DependencyFacade dependency = (DependencyFacade)object;
                    // first check for exception references
                    hasException = dependency.hasStereotype(UMLProfile.STEREOTYPE_EXCEPTION_REF);

                    // if there wasn't any exception reference
                    // now check for actual exceptions
                    if (!hasException)
                    {
                        ModelElementFacade targetElement = dependency.getTargetElement();
                        hasException = targetElement != null && targetElement.hasStereotype(
                                UMLProfile.STEREOTYPE_EXCEPTION);
                    }
                }
                return hasException;
            }
        }

        // first get any dependencies on this operation's
        // owner (because these will represent the default exception(s))
        final Collection ownerDependencies = new ArrayList(this.getOwner().getSourceDependencies());
        if (ownerDependencies != null && !ownerDependencies.isEmpty())
        {
            CollectionUtils.filter(ownerDependencies, new ExceptionFilter());
            exceptions.addAll(ownerDependencies);
        }

        final Collection operationDependencies = new ArrayList(this.getSourceDependencies());
        // now get any exceptions directly on the operation
        if (operationDependencies != null && !operationDependencies.isEmpty())
        {
            CollectionUtils.filter(operationDependencies, new ExceptionFilter());
            exceptions.addAll(operationDependencies);
        }

        // now transform the dependency(s) to the actual exception(s)
        CollectionUtils.transform(exceptions, new Transformer()
        {
View Full Code Here

    private void copyProperties(
        final Object from,
        final GroovyObject to)
        throws Exception
    {
        final Set methods = new LinkedHashSet();
        loadSuperMethods(
            from.getClass(),
            methods);
        for (final Iterator iterator = methods.iterator(); iterator.hasNext();)
        {
            final Method method = (Method)iterator.next();

            final String methodName = method.getName();
            final String getPrefix = "get";
View Full Code Here

TOP

Related Classes of java.util.LinkedHashSet$MyIterator

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.