Package me.autobot.lib.math
Class Unit
java.lang.Object
me.autobot.lib.math.Unit
A class to represent a unit of measurement. Can be used for conversion, tracking, etc.
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
Unit
public Unit(double inMeters) Creates a unit with the value in meters.- Parameters:
inMeters
- The value in meters
-
Unit
Creates a unit with the value in the given unit.- Parameters:
value
- The value in the given unittype
- The unit of the value
-
-
Method Details
-
zero
The zero unit. Equivalent to 0 meters, or 0 of any other unit.- Returns:
- The zero unit
-
getValue
Gets the value in the given unit.- Parameters:
type
- The unit to convert to- Returns:
- The value in the given unit
-
getValue
public double getValue()Returns the value in meters.- Returns:
- The value in meters
-