/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package structures;

//import java.text.DateFormat;
import java.util.Date;
//import java.util.GregorianCalendar;

/**
 *
 * @author baba
 */
public class HashEntry {
    private String hashID = "";
    private String hashKey = "";
    private String hashValue = "";
    private String time = "";
    private boolean changeTime = false;
    private String returnString = "";

    public HashEntry(String whichHashID,String key, String value){
        hashKey = key;
        hashValue = value;
        hashID = whichHashID;
        returnString = hashKey + "=>"+hashValue;
    }
    /**
     * @return the time
     */
    public String getTime() {
        //if (isChangeTime()) {
            //GregorianCalendar liftOffApollo11 = new GregorianCalendar();
            //Date d = liftOffApollo11.getTime();
            //DateFormat df2 = DateFormat.getTimeInstance(DateFormat.SHORT);
            Date date = new Date();
            time = date.toString();
        //}
        return time;
    }

    @Override
    public String toString() {
        if (isChangeTime()) {
            returnString= hashKey + "=>"+hashValue+ " --- " + getTime();
            setChangeTime(false);
        }
        return returnString;
    }

    /**
     * @return the hashKey
     */
    public String getHashKey() {
        return hashKey;
    }

    /**
     * @param hashKey the hashKey to set
     */
    public void setHashKey(String hashKey) {
        this.hashKey = hashKey;
    }

    /**
     * @return the hashValue
     */
    public String getHashValue() {
        return hashValue;
    }

    /**
     * @param hashValue the hashValue to set
     */
    public void setHashValue(String hashValue) {
        this.hashValue = hashValue;
    }

    /**
     * @return the hashID
     */
    public String getHashID() {
        return hashID;
    }

    /**
     * @param hashID the hashID to set
     */
    public void setHashID(String hashID) {
        this.hashID = hashID;
    }

    /**
     * @return the changeTime
     */
    public boolean isChangeTime() {
        return changeTime;
    }

    /**
     * @param changeTime the changeTime to set
     */
    public void setChangeTime(boolean changeTime) {
        this.changeTime = changeTime;
    }
}
