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

gov.sandia.cognition.learning.data.AbstractInputOutputPair Maven / Gradle / Ivy

There is a newer version: 4.0.1
Show newest version
/*
 * File:                AbstractInputOutputPair.java
 * Authors:             Justin Basilico
 * Company:             Sandia National Laboratories
 * Project:             Cognitive Foundry
 * 
 * Copyright May 26, 2010, 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.learning.data;

import gov.sandia.cognition.util.AbstractCloneableSerializable;

/**
 * An abstract implementation of the {@code InputOutputPair} interface. It
 * implements the toString, getFirst, and getSecond methods.
 *
 * @param  
 *      The type for the input object in the pair.
 * @param  
 *      The type for the output object in the pair.
 * @author  Justin Basilico
 * @since   3.0
 */
public abstract class AbstractInputOutputPair
    extends AbstractCloneableSerializable
    implements InputOutputPair
{

    /**
     * Creates a new {@code AbstractInputOutputPair}.
     */
    public AbstractInputOutputPair()
    {
        super();
    }

    @Override
    public String toString()
    {
        return "(input=" + this.getInput()
            + ", output=" + this.getOutput() + ")";
    }

    /**
     * Gets the input, which is the first element in the pair.
     *
     * @return
     *      The input.
     */
    public InputType getFirst()
    {
        return this.getInput();
    }

    /**
     * Gets the output, which is the second element in the pair.
     *
     * @return
     *      The output.
     */
    public OutputType getSecond()
    {
        return this.getOutput();
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy