Package com.irurueta.units
Class Surface
- All Implemented Interfaces:
Serializable
Contains a surface value and unit.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionSurface()Constructor.Surface(Number value, SurfaceUnit unit) Constructor with value and units. -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(double value, SurfaceUnit unit) Adds provided surface value and unit and updates current surface instance.static doubleadd(double value1, SurfaceUnit unit1, double value2, SurfaceUnit unit2, SurfaceUnit resultUnit) Adds two surface values and units and returns the result.voidAdds provided surface and updates current distance.voidAdds provided surface and stores the result into provided surface.static voidAdds two surfaces and stores the result into provided instance.voidadd(Number value, SurfaceUnit unit) Adds provided surface value and unit and updates current surface instance.static Numberadd(Number value1, SurfaceUnit unit1, Number value2, SurfaceUnit unit2, SurfaceUnit resultUnit) Adds to surface values and units and returns the result.addAndReturnNew(double value, SurfaceUnit unit, SurfaceUnit resultUnit) Adds provided surface value and unit and returns a new surface instance using provided unit.static SurfaceaddAndReturnNew(Surface arg1, Surface arg2, SurfaceUnit unit) Adds two surfaces.addAndReturnNew(Surface s, SurfaceUnit unit) Adds provided surface to current instance and returns a new surface.addAndReturnNew(Number value, SurfaceUnit unit, SurfaceUnit resultUnit) Adds provided surface value and unit and returns a new surface instance using provided unit.booleanequals(Measurement<SurfaceUnit> other, double tolerance) Determines if two surfaces are equal up to a certain tolerance.voidsubtract(double value, SurfaceUnit unit) Subtracts provided surface value and unit and updates current surface instance.static doublesubtract(double value1, SurfaceUnit unit1, double value2, SurfaceUnit unit2, SurfaceUnit resultUnit) Subtracts two surface values and units and returns the result.voidSubtracts provided surface and updates current surface.voidSubtracts provided surface and stores the result into provided surface.static voidSubtracts two surfaces and stores the result into provided instance.voidsubtract(Number value, SurfaceUnit unit) Subtracts provided surface value and unit and updates current surface instance.static Numbersubtract(Number value1, SurfaceUnit unit1, Number value2, SurfaceUnit unit2, SurfaceUnit resultUnit) Subtracts two surface values and units and returns the result.subtractAndReturnNew(double value, SurfaceUnit unit, SurfaceUnit resultUnit) Subtracts provided surface value and unit and returns a new surface instance using provided unit.static SurfacesubtractAndReturnNew(Surface arg1, Surface arg2, SurfaceUnit unit) Subtracts two surfaces.subtractAndReturnNew(Surface s, SurfaceUnit unit) Subtracts provided surface to current instance and returns a new surface.subtractAndReturnNew(Number value, SurfaceUnit unit, SurfaceUnit resultUnit) Subtracts provided surface value and unit and returns a new surface instance using provided unit.
-
Constructor Details
-
Surface
Constructor with value and units.- Parameters:
value- surface value.unit- unit of surface.- Throws:
IllegalArgumentException- if either value or unit is null.
-
Surface
Surface()Constructor.
-
-
Method Details
-
equals
Determines if two surfaces are equal up to a certain tolerance. If needed, this method attempts unit conversion to compare both objects.- Overrides:
equalsin classMeasurement<SurfaceUnit>- Parameters:
other- another surface to compare.tolerance- amount of tolerance to determine whether two surface instances are equal or not.- Returns:
- true if provided surface is assumed to be equal to this instance, false otherwise.
-
add
public static double add(double value1, SurfaceUnit unit1, double value2, SurfaceUnit unit2, SurfaceUnit resultUnit) Adds two surface values and units and returns the result.- Parameters:
value1- 1st argument value.unit1- 1st argument unit.value2- 2nd argument value.unit2- 2nd argument unit.resultUnit- unit of result to be returned.- Returns:
- result of addition.
-
add
public static Number add(Number value1, SurfaceUnit unit1, Number value2, SurfaceUnit unit2, SurfaceUnit resultUnit) Adds to surface values and units and returns the result.- Parameters:
value1- 1st argument value.unit1- 1st argument unit.value2- 2nd argument value.unit2- 2nd argument unit.resultUnit- unit of result to be returned.- Returns:
- result of addition.
-
add
Adds two surfaces and stores the result into provided instance.- Parameters:
arg1- 1st argument.arg2- 2nd argument.result- instance where result will be stored.
-
addAndReturnNew
Adds two surfaces.- Parameters:
arg1- 1st argument.arg2- 2nd argument.unit- unit of returned surface.- Returns:
- a new instance containing result.
-
addAndReturnNew
Adds provided surface value and unit and returns a new surface instance using provided unit.- Parameters:
value- value to be added.unit- unit of value to be added.resultUnit- unit of returned surface.- Returns:
- a new surface containing result.
-
addAndReturnNew
Adds provided surface value and unit and returns a new surface instance using provided unit.- Parameters:
value- value to be added.unit- unit of value to be added.resultUnit- unit of returned surface.- Returns:
- a new surface containing result.
-
addAndReturnNew
Adds provided surface to current instance and returns a new surface.- Parameters:
s- surface to be added.unit- unit of returned surface.- Returns:
- a new surface containing result.
-
add
Adds provided surface value and unit and updates current surface instance.- Parameters:
value- surface value to be added.unit- unit of surface value.
-
add
Adds provided surface value and unit and updates current surface instance.- Parameters:
value- surface value to be added.unit- unit of surface value.
-
add
Adds provided surface and updates current distance.- Parameters:
surface- surface to be added.
-
add
Adds provided surface and stores the result into provided surface.- Parameters:
s- surface to be added.result- instance where result will be stored.
-
subtract
public static double subtract(double value1, SurfaceUnit unit1, double value2, SurfaceUnit unit2, SurfaceUnit resultUnit) Subtracts two surface values and units and returns the result.- Parameters:
value1- 1st argument value.unit1- 1st argument unit.value2- 2nd argument value.unit2- 2nd argument unit.resultUnit- unit of result to be returned.- Returns:
- result of subtraction.
-
subtract
public static Number subtract(Number value1, SurfaceUnit unit1, Number value2, SurfaceUnit unit2, SurfaceUnit resultUnit) Subtracts two surface values and units and returns the result.- Parameters:
value1- 1st argument value.unit1- 1st argument unit.value2- 2nd argument value.unit2- 2nd argument unit.resultUnit- unit of result to be returned.- Returns:
- result of subtraction.
-
subtract
Subtracts two surfaces and stores the result into provided instance.- Parameters:
arg1- 1st argument.arg2- 2nd argument.result- instance where result will be stored.
-
subtractAndReturnNew
Subtracts two surfaces.- Parameters:
arg1- 1st argument.arg2- 2nd argument.unit- unit of returned surface.- Returns:
- a new instance containing result.
-
subtractAndReturnNew
Subtracts provided surface value and unit and returns a new surface instance using provided unit.- Parameters:
value- value to be subtracted.unit- unit of value to be subtracted.resultUnit- unit of returned surface.- Returns:
- a new surface containing result.
-
subtractAndReturnNew
Subtracts provided surface value and unit and returns a new surface instance using provided unit.- Parameters:
value- value to be subtracted.unit- unit of value to be subtracted.resultUnit- unit of returned time.- Returns:
- a new surface containing result.
-
subtractAndReturnNew
Subtracts provided surface to current instance and returns a new surface.- Parameters:
s- surface to be subtracted.unit- unit of returned surface.- Returns:
- a new surface containing result.
-
subtract
Subtracts provided surface value and unit and updates current surface instance.- Parameters:
value- surface value to be subtracted.unit- unit of surface value.
-
subtract
Subtracts provided surface value and unit and updates current surface instance.- Parameters:
value- surface value to be subtracted.unit- unit of surface value.
-
subtract
Subtracts provided surface and updates current surface.- Parameters:
surface- surface to be subtracted.
-
subtract
Subtracts provided surface and stores the result into provided surface.- Parameters:
s- surface to be subtracted.result- instance where result will be stored.
-