Package org.apache.commons.collections

Examples of org.apache.commons.collections.Transformer


            {
                DependencyFacade dependency = (DependencyFacade)object;
                return dependency != null && dependency.getSourceElement() instanceof Role;
            }
        });
        CollectionUtils.transform(roles, new Transformer()
        {
            public Object transform(final Object object)
            {
                return ((DependencyFacade)object).getSourceElement();
            }
View Full Code Here


    protected java.util.Collection handleGetNavigableConnectingEnds()
    {
        final Collection connectingEnds = new ArrayList(this.getAssociationEnds());
        CollectionUtils.transform(
            connectingEnds,
            new Transformer()
            {
                public Object transform(final Object object)
                {
                    return ((AssociationEndFacade)object).getOtherEnd();
                }
View Full Code Here

        final Collection connectingEnds = this.shieldedElements(UmlUtilities.getAssociationEnds(
                    this.metaObject,
                    follow));
        CollectionUtils.transform(
            connectingEnds,
            new Transformer()
            {
                public Object transform(final Object object)
                {
                    return ((AssociationEndFacade)object).getOtherEnd();
                }
View Full Code Here

     */
    protected Collection handleGetValues()
    {
        final Collection values = new ArrayList(this.metaObject.getValues());

        CollectionUtils.transform(values, new Transformer()
        {
            public Object transform(Object object)
            {
                return InstanceFacadeLogicImpl.createInstanceFor((ValueSpecification)object);
            }
View Full Code Here

    protected Collection handleGetNavigableConnectingEnds()
    {
        final Collection connectingEnds = new ArrayList(this.getAssociationEnds());
        CollectionUtils.transform(
            connectingEnds,
            new Transformer()
            {
                public Object transform(final Object object)
                {
                    return ((AssociationEndFacade)object).getOtherEnd();
                }
View Full Code Here

                                if (!tagValues.isEmpty())
                                {
                                    Collection tagValuesInString =
                                        CollectionUtils.collect(
                                            tagValues,
                                            new Transformer()
                                            {
                                                public Object transform(Object object)
                                                {
                                                    return getTagValueAsString(object);
                                                }
View Full Code Here

     */
    protected java.util.Collection handleGetInstances()
    {
        final Collection values = new ArrayList(this.metaObject.getValues());

        CollectionUtils.transform(values, new Transformer()
        {
            public Object transform(Object object)
            {
                return UmlUtilities.ELEMENT_TRANSFORMER.transform(((InstanceValue)object).getInstance());
            }
View Full Code Here

            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();
            }
View Full Code Here

            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();
            }
View Full Code Here

        collection.add(testObject);
        testObject = new OCLCollectionsTestObject();
        testObject.setPropertyOne("propertyOneAgain");
        collection.add(testObject);
        assertEquals(2, collection.size());
        assertTrue(OCLCollections.isUnique(collection, new Transformer()
        {
            public Object transform(Object object)
            {
                return OCLIntrospector.invoke(object, "propertyOne");
            }

        }));
        assertTrue(OCLCollections.isUnique((Object) collection, new Transformer()
        {
            public Object transform(Object object)
            {
                return OCLIntrospector.invoke(object, "propertyOne");
            }

        }));
        testObject = new OCLCollectionsTestObject();
        testObject.setPropertyOne("propertyOne");
        collection.add(testObject);
        assertEquals(3, collection.size());
        assertFalse(OCLCollections.isUnique(collection, new Transformer()
        {
            public Object transform(Object object)
            {
                return OCLIntrospector.invoke(object, "propertyOne");
            }

        }));
        assertFalse(OCLCollections.isUnique((Object) collection, new Transformer()
        {
            public Object transform(Object object)
            {
                return OCLIntrospector.invoke(object, "propertyOne");
            }

        }));
        collection.remove(testObject);
        assertEquals(2, collection.size());
        assertTrue(OCLCollections.isUnique(collection, new Transformer()
        {
            public Object transform(Object object)
            {
                return OCLIntrospector.invoke(object, "propertyOne");
            }

        }));
        assertTrue(OCLCollections.isUnique((Object) collection, new Transformer()
        {
            public Object transform(Object object)
            {
                return OCLIntrospector.invoke(object, "propertyOne");
            }
View Full Code Here

TOP

Related Classes of org.apache.commons.collections.Transformer

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.