/*
 * To change this license header, choose License Headers in
 * Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package modelo;


import java.util.Objects;

/**
 *
 * @author Catalina
 */
public class Raton implements Comparable <Raton> {

    public enum Sexo {
        MACHO, HEMBRA
    }

    public enum Cromosomas {

        XX, XY, XMXM, XMX, XXM, XMY, XYM, XMYM

    }
//@todo encapsulacion de atributos
    public final String codigoDeReferencia, descripcion;
    public final Sexo sexo;
    public final Fecha fechaNacimiento;
    public final int peso;
    public final float temperatura;
    public final Cromosomas cromosomas;

    public Raton() {
        this("", "", Sexo.HEMBRA, new Fecha(1,1,2017), 0, 0, Cromosomas.XX);
    }

    public Raton(String codigoDeReferencia, String descripcion,Sexo sexo, Fecha fechaNacimiento,int peso, float temperatura, Cromosomas cromosomas) {

        this.codigoDeReferencia = codigoDeReferencia;
        this.descripcion = descripcion;
        this.sexo = sexo;
        this.fechaNacimiento = fechaNacimiento;
        this.peso = peso;
        this.temperatura = temperatura;
        this.cromosomas = cromosomas;

    }

    public String getCodigoDeReferencia() {
        return codigoDeReferencia;
    }

    public Cromosomas getCromosomas() {
        return cromosomas;
    }

    public String getDescripcion() {
        return descripcion;
    }

    public Sexo getSexo() {
        return sexo;
    }

    public Fecha getFechaNacimiento() {
        return fechaNacimiento;
    }

    public int getPeso() {
        return peso;
    }

    public float getTemperatura() {
        return temperatura;
    }
    
     @Override
    public int compareTo(Raton o) {
   if(codigoDeReferencia.compareTo(o.getCodigoDeReferencia())<0){
            return -1;
        }
        else if(codigoDeReferencia.compareTo(o.getCodigoDeReferencia())>0){
            return 1;
        }
        else return 0;
    }

    @Override
    public int hashCode() {
        int hash = 3;
        hash = 17 * hash + Objects.hashCode(this.codigoDeReferencia);
        return hash;
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final Raton other = (Raton) obj;
        if (!Objects.equals(this.codigoDeReferencia, other.codigoDeReferencia)) {
            return false;
        }
        return true;
    }
    
    @Override
    public String toString() {

        return "\nCodigo de referencia: " +codigoDeReferencia + "\nDescripcion: "+ descripcion + "\nSexo: " 
                  + sexo + "\nFecha de nacimiento: "+ fechaNacimiento.getdia() + "/"  + fechaNacimiento.getmes() + "/"
                 + fechaNacimiento.getano() + "\nPeso: "+ peso + "\nTemperatura: " + temperatura + "\nCromosomas: " + cromosomas;
              
                
               
               
                
                


    }

}
