All Downloads are FREE. Search and download functionalities are using the official Maven repository.

gov.sandia.cognition.framework.learning.converter.CogxelTargetEstimatePairConverter Maven / Gradle / Ivy

There is a newer version: 4.0.1
Show newest version
/*
 * File:                CogxelTargetEstimatePairConverter.java
 * Authors:             Kevin R. Dixon
 * Company:             Sandia National Laboratories
 * Project:             Cognitive Foundry
 * 
 * Copyright Nov 18, 2008, Sandia Corporation.
 * Under the terms of Contract DE-AC04-94AL85000, there is a non-exclusive
 * license for use of this work by or on behalf of the U.S. Government. 
 * Export of this program may require a license from the United States
 * Government. See CopyrightHistory.txt for complete details.
 * 
 */

package gov.sandia.cognition.framework.learning.converter;

import gov.sandia.cognition.framework.SemanticIdentifierMap;
import gov.sandia.cognition.learning.data.DefaultTargetEstimatePair;
import gov.sandia.cognition.learning.data.TargetEstimatePair;

/**
 * CogxelConverter based on a TargetEstimatePair.
 * 
 * @param  Type of the targets
 * @param  Type of the estimates
 * @author Kevin R. Dixon
 * @since 3.0
 */
public class CogxelTargetEstimatePairConverter
    extends AbstractCogxelPairConverter>
{

    /**
     * Creates a new CogxelTargetEstimatePairConverter.
     */
    public CogxelTargetEstimatePairConverter()
    {
        this(null, null);
    }

    /**
     * Creates a new CogxelTargetEstimatePairConverter with the given
     * converters for each element of the pair.
     *
     * @param  targetConverter
     *      The CogxelConverter for the target element of the pair.
     * @param  estimateConverter
     *      The CogxelConverter for the estimate element of the pair.
     */
    public CogxelTargetEstimatePairConverter(
        final CogxelConverter targetConverter,
        final CogxelConverter estimateConverter)
    {
        this(targetConverter, estimateConverter, null);
    }

    /**
     * Creates a new CogxelTargetEstimatePairConverter with the given
     * converters for each element of the pair.
     *
     * @param  targetConverter
     *      The CogxelConverter for the target element of the pair.
     * @param  estimateConverter
     *      The CogxelConverter for the estimate element of the pair.
     * @param semanticIdentifierMap 
     *      The SemanticIdentifierMap for the converter.
     */
    public CogxelTargetEstimatePairConverter(
        final CogxelConverter targetConverter,
        final CogxelConverter estimateConverter,
        final SemanticIdentifierMap semanticIdentifierMap)
    {
        super(targetConverter, estimateConverter, semanticIdentifierMap);
    }

    @Override
    public TargetEstimatePair createPair(
        final TargetType first,
        final EstimateType second)
    {
        return DefaultTargetEstimatePair.create(first, second);
    }

    @Override
    public boolean equals(
        final Object other)
    {
        return other instanceof CogxelTargetEstimatePairConverter
            && super.equals(other);
    }

    @Override
    public int hashCode()
    {
        return super.hashCode();
    }

    /**
     * Gets the converter for the target value.
     *
     * @return
     *      The target converter.
     */
    public CogxelConverter getTargetConverter()
    {
        return this.getFirstConverter();
    }

    /**
     * Sets the converter for the target value.
     *
     * @param   targetConverter
     *      The target converter.
     */
    public void setTargetConverter(
        final CogxelConverter targetConverter)
    {
        this.setFirstConverter(targetConverter);
    }

    /**
     * Gets the converter for the estimate value.
     *
     * @return
     *      The estimate converter.
     */
    public CogxelConverter getEstimateConverter()
    {
        return this.getSecondConverter();
    }

    /**
     * Sets the converter for the estimate value.
     *
     * @param   estimateConverter
     *      The estimate converter.
     */
    public void setEstimateConverter(
        final CogxelConverter estimateConverter)
    {
        this.setSecondConverter(estimateConverter);
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy