termo.data.Experimental Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of materia Show documentation
Show all versions of materia Show documentation
Thermodynamics properties and
equilibria calculations for
chemical engineering.
/*
* 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 termo.data;
import java.io.Serializable;
import java.util.Objects;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.MappedSuperclass;
/**
*
* @author Hugo
*/
@MappedSuperclass
public abstract class Experimental implements Serializable{
protected double temperature;
protected double pressure;
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
protected Long id;
public Experimental() {
}
public Experimental(double temperature, double pressure){
this.temperature = temperature;
this.pressure = pressure;
}
@Override
public int hashCode() {
int hash = 7;
hash = 59 * hash + (int) (Double.doubleToLongBits(this.temperature) ^ (Double.doubleToLongBits(this.temperature) >>> 32));
hash = 59 * hash + (int) (Double.doubleToLongBits(this.pressure) ^ (Double.doubleToLongBits(this.pressure) >>> 32));
hash = 59 * hash + Objects.hashCode(this.id);
return hash;
}
@Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final Experimental other = (Experimental) obj;
if (Double.doubleToLongBits(this.temperature) != Double.doubleToLongBits(other.temperature)) {
return false;
}
if (Double.doubleToLongBits(this.pressure) != Double.doubleToLongBits(other.pressure)) {
return false;
}
if (!Objects.equals(this.id, other.id)) {
return false;
}
return true;
}
/**
* @return the temperature
*/
public double getTemperature() {
return temperature;
}
/**
* @param temperature the temperature to set
*/
public void setTemperature(double temperature) {
this.temperature = temperature;
}
/**
* @return the pressure
*/
public double getPressure() {
return pressure;
}
/**
* @param pressure the pressure to set
*/
public void setPressure(double pressure) {
this.pressure = pressure;
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy