package usda.weru.util;

/**
 *
 * @author cademccumber
 * Basic functionality of a pair, similar to std::pair in c++
 * better than allocating a whole hash table for a single pair or a known size of 
 * values. 
 */
public class Pair< T1, T2> {
    // class 
    private T1 key;
    private T2 value;
    
    public Pair(T1 key, T2 value) {
        this.key = key;
        this.value = value;
    }
    
    /**
     * gets the the first element of generic type specified.
     * @return key 
     */
    public T1 getKey() {
        return this.key;
    }
    
    /**
     * gets the the second element of generic type specified.
     * @return value
     */
    public T2 getValue() {
        return this.value;
    }
    
    /**
     * sets the first element 
     * @param key new value of key
     */
    public void setKey(T1 key) {
        this.key = key;
    }
    
    /**
     * sets the second element
     * @param value new value of second element
     */
    public void setValue(T2 value) {
        this.value = value;
    }
}
