src/main/java/de/javagl/geom/AffineTransforms.java
/**
     * Creates a function that returns an affine transform that is the
     * concatenation of the affine transforms returned by the given 
     * functions. If either of the functions returns <code>null</code>,
     * then the result will be equal to the affine transform of the 
     * other function. If both functions return <code>null</code>, then
     * the function will also return <code>null</code>.  
     * 
     * @param <T> The function argument type
     * 
     * @param f0 The first function
     * @param f1 The second function
     * @return The function
     */
Creates a function that returns an affine transform that is the
concatenation of the affine transforms returned by the given
functions. If either of the functions returns null,
then the result will be equal to the affine transform of the
other function. If both functions return null, then
the function will also return null.

@param  The function argument type

@param f0 The first function
@param f1 The second function
@return The function
Creates a function that returns an affine transform that is the concatenation of the affine transforms returned by the given functions . If either of the functions returns null then the result will be equal to the affine transform of the other function . If both functions return null then the function will also return null . @param The function argument type @param f0 The first function @param f1 The second function @return The function
public static <T> Function<T, AffineTransform> compose(
        final Function<? super T, ? extends AffineTransform> f0, 
        final Function<? super T, ? extends AffineTransform> f1)
    {
        return new Function<T, AffineTransform>()
        {
            @Override
            public AffineTransform apply(T t)
            {
                AffineTransform at0 = f0.apply(t);
                AffineTransform at1 = f1.apply(t);
                if (at0 == null)
                {
                    if (at1 == null)
                    {
                        return null;
                    }
                }
                if (at1 == null)
                {
                    return new AffineTransform(at1);
                }
                AffineTransform at = new AffineTransform(at0);
                at.concatenate(at1);
                return at;
            }
        };
    }
public static < T > Function < T , AffineTransform > compose ( final Function < ? super T , ? extends AffineTransform > f0 , final Function < ? super T , ? extends AffineTransform > f1 ) { return new Function < T , AffineTransform > ( ) { @ Override public AffineTransform apply ( T t ) { AffineTransform at0 = f0 . apply ( t ) ; AffineTransform at1 = f1 . apply ( t ) ; if ( at0 == null ) { if ( at1 == null ) { return null ; } } if ( at1 == null ) { return new AffineTransform ( at1 ) ; } AffineTransform at = new AffineTransform ( at0 ) ; at . concatenate ( at1 ) ; return at ; } } ; }
Creates a function that returns an affine transform that is the
 concatenation of the affine transforms returned by the given
 functions.
Creates a function that returns an affine transform that is the concatenation of the affine transforms returned by the given functions .