/*
 * Copyright (c) 2009 JSCAPE
 * 1147 S. 53rd Pl., Mesa, Arizona, 85206, U.S.A.
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of
 * JSCAPE. ("Confidential Information").  You shall not disclose such
 * Confidential Information and shall use it only in accordance with
 * the terms of the license agreement you entered into with JSCAPE.
 *
 */

package com.jscape.util.functor.adapters;

import com.jscape.util.functor.BinaryFunction;
import com.jscape.util.functor.UnaryFunction;

/**
 * @author Alex Usun
 */
public class BoundSecondUnaryFunction<F, S, R>
        extends UnaryFunction<F, R> {

    private BinaryFunction<? super F, ? super S, ? extends R> base;
    private S second;

    /**
     * @param base   base
     * @param second second
     */
    public BoundSecondUnaryFunction(BinaryFunction<? super F, ? super S, ? extends R> base, S second) {
        this.base = base;
        this.second = second;
    }

    /**
     * @param value value
     *
     * @return r instance
     */
    public R evaluate(F value) {
        return this.base.evaluate(value, this.second);
    }
}