public final class Offset extends Object implements Serializable
Constructor and Description |
---|
Offset(double value,
LinearUnit unit)
Create Offset object.
|
Modifier and Type | Method and Description |
---|---|
static Offset |
convert(Offset offset,
LinearUnit unit)
Returns the specified Offset converted from its LinearUnit to the
specified LinearUnit.
|
boolean |
equals(Object o)
Equals implementation.
|
boolean |
equivalent(Offset offset)
Is this offset equivalent to the given offset.
|
boolean |
equivalent(Offset offset,
double tolerance)
Is this offset equivalent to the given offset within the given tolerance.
|
LinearUnit |
getUnit()
Get the unit of measure for this offset.
|
double |
getValue()
Get the value of measure for this offset.
|
double |
getValue(LinearUnit unit)
Return the offset in the requested unit, converting if necessary.
|
int |
hashCode()
Hashcode implementation.
|
public Offset(double value, LinearUnit unit)
value
- the value of measure for this offset.unit
- the unit of measure for this offset.IllegalArgumentException
- if the specified unit is null.public LinearUnit getUnit()
public double getValue()
Offset.getUnit()
.public double getValue(LinearUnit unit)
unit
- the desired unit.IllegalArgumentException
- if the specified unit is null.public boolean equivalent(Offset offset)
Offset.equivalent(Offset,double)
with tolerance == 0;offset
- offset to test for equivalence.public boolean equivalent(Offset offset, double tolerance)
offset
- offset to test for equivalence.tolerance
- the tolerance value to test with. Specified in meters.public boolean equals(Object o)
public int hashCode()
public static Offset convert(Offset offset, LinearUnit unit)
offset
- The Offset to convert.unit
- The unit to convert the specified Offset to.