public class Length
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
Length.Field |
Constructor and Description |
---|
Length() |
Length(double value,
LengthUnit units) |
Modifier and Type | Method and Description |
---|---|
Length |
add(double d) |
Length |
add(Length length) |
int |
compareTo(Length other) |
static double |
convertToUnits(double value,
LengthUnit fromUnits,
LengthUnit toUnits) |
Length |
convertToUnits(LengthUnit units) |
Length |
divide(double d) |
double |
divide(Length length) |
boolean |
equals(java.lang.Object obj) |
LengthUnit |
getUnits() |
double |
getValue() |
int |
hashCode() |
boolean |
isInitialized() |
Length |
modulo(Length length) |
Length |
multiply(double d) |
Area |
multiply(Length length) |
static Length |
parse(java.lang.String s) |
static Length |
parse(java.lang.String s,
boolean requireUnits)
Takes a value in the format of a double followed by any number of spaces followed by the
shortName of a LengthUnit value and returns the value as a Length object.
|
static Location |
setLocationField(Configuration configuration,
Location location,
Length length,
Length.Field field)
Sets the specified field on the passed Location object.
|
static Location |
setLocationField(Configuration configuration,
Location location,
Length length,
Length.Field field,
boolean defaultToOldUnits) |
void |
setUnits(LengthUnit units) |
void |
setValue(double value) |
Length |
subtract(double d) |
Length |
subtract(Length length) |
java.lang.String |
toString() |
java.lang.String |
toString(java.lang.String fmt)
Performs the same function as toString() but allows the caller to specify the format String
that is used.
|
public Length()
public Length(double value, LengthUnit units)
public Length add(double d)
public Length subtract(double d)
public Length multiply(double d)
public Length divide(double d)
public double divide(Length length)
public double getValue()
public void setValue(double value)
public LengthUnit getUnits()
public void setUnits(LengthUnit units)
public Length convertToUnits(LengthUnit units)
public static double convertToUnits(double value, LengthUnit fromUnits, LengthUnit toUnits)
public static Length parse(java.lang.String s)
public static Length parse(java.lang.String s, boolean requireUnits)
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toString(java.lang.String fmt)
fmt
- public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public static Location setLocationField(Configuration configuration, Location location, Length length, Length.Field field, boolean defaultToOldUnits)
public static Location setLocationField(Configuration configuration, Location location, Length length, Length.Field field)
configuration
- location
- length
- field
- public int compareTo(Length other)
public boolean isInitialized()