eu.printingin3d.physics.BasicOperations Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of simplephysics Show documentation
Show all versions of simplephysics Show documentation
Simple Java Objects for SI units like frequency or current.
package eu.printingin3d.physics;
public abstract class BasicOperations> extends DoubleValue {
protected BasicOperations(double value) {
super(value);
}
protected abstract T convert(double value);
public final T add(T value) {
return convert(this.value+value.value);
}
public final T substract(T value) {
return convert(this.value-value.value);
}
public final T multiply(double d) {
return convert(this.value*d);
}
public final T multiply(Percent d) {
return multiply(d.getValue());
}
public final T abs() {
return convert(Math.abs(value));
}
public final boolean isPositive() {
return value>0.0;
}
public final boolean isNegative() {
return value<0.0;
}
public final boolean isZero() {
return value == 0.0;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy