package materials;

import physics.unit.Quantity;
import physics.unit.Quantity.Prefix;
import physics.unit.Quantity.Unit;

public class Material {
	
	public static final Material STEEL = new Material(new Quantity(210,Prefix.GIGA,Unit.Pa));

	/**
	 * Young's modulus, Tensile modulus or elastic modulus.
	 */
	Quantity youngsModulus;
	
	public Material(Quantity youngsModulus){
		this.youngsModulus = youngsModulus;
	}
	
	public Quantity getYoungsModulus(){
		return youngsModulus;
	}
	
	@Override
	public String toString() {
		String result = "Material properties:\n";
		if(youngsModulus != null)
			result += "Young's modulus: " + youngsModulus + "\n";
		return result;
	}
	
	public static void main(String[] args) {

		Material steel1 = new Material(new Quantity(210e9,Unit.Pa));
		System.out.println(steel1);
		System.out.println(steel1.youngsModulus);
		System.out.println(steel1.youngsModulus.getValue());
		System.out.println();
		
		Material steel2 = new Material(new Quantity(210,Prefix.GIGA,Unit.Pa));
		System.out.println(steel2);
		System.out.println(steel2.youngsModulus);
		System.out.println(steel2.youngsModulus.getValue());
		
	}

}
