lojix/wam_prolog/src/main/com/thesett/aima/logic/fol/wam/builtins/BuiltInTransform.java
public Functor apply(Functor functor)
    {
        FunctorName functorName = defaultBuiltIn.getInterner().getFunctorFunctorName(functor);

        Class<? extends BuiltInFunctor> builtInClass;

        builtInClass = builtIns.get(functorName);

        if (builtInClass != null)
        {
            return ReflectionUtils.newInstance(ReflectionUtils.getConstructor(builtInClass,
                    new Class[] { Functor.class, DefaultBuiltIn.class }), new Object[] { functor, defaultBuiltIn });
        }
        else
        {
            return functor;
        }
    }
public Functor apply(Functor functor)
    {
        FunctorName functorName = defaultBuiltIn.getInterner().getFunctorFunctorName(functor);

        Class<? extends BuiltInFunctor> builtInClass;

        builtInClass = builtIns.get(functorName);

        if (builtInClass != null)
        {
            return ReflectionUtils.newInstance(ReflectionUtils.getConstructor(builtInClass,
                    new Class[] { Functor.class, DefaultBuiltIn.class }), new Object[] { functor, defaultBuiltIn });
        }
        else
        {
            return functor;
        }
    }
public Functor apply ( Functor functor ) { FunctorName functorName = defaultBuiltIn . getInterner ( ) . getFunctorFunctorName ( functor ) ; Class < ? extends BuiltInFunctor > builtInClass ; builtInClass = builtIns . get ( functorName ) ; if ( builtInClass != null ) { return ReflectionUtils . newInstance ( ReflectionUtils . getConstructor ( builtInClass , new Class [ ] { Functor . class , DefaultBuiltIn . class } ) , new Object [ ] { functor , defaultBuiltIn } ) ; } else { return functor ; } }
Applies a built-in replacement transformation to functors. If the functor matches built-in, a
{@link BuiltInFunctor} is created with a mapping to the functors built-in implementation, and the functors
arguments are copied into this new functor. If the functor does not match a built-in, it is returned unmodified.

@param  functor The functor to attempt to map onto a built-in.

@return The functor unmodified, or a {@link BuiltInFunctor} replacement for it.
Applies a built - in replacement transformation to functors . If the functor matches built - in a { @link BuiltInFunctor } is created with a mapping to the functors built - in implementation and the functors arguments are copied into this new functor . If the functor does not match a built - in it is returned unmodified .