Volume
public final class Volume implements Comparable
Represents a unit of volume. Supported units:
-
liters - see
Volume.liters,Double.liters -
milliliters - see
Volume.milliliters,Double.milliliters -
US fluid ounces - see
Volume.fluidOuncesUs,Double.fluidOuncesUs
Summary
Public methods |
|
|---|---|
int |
|
boolean |
|
static final @NonNull Volume |
fluidOuncesUs(double value)Creates |
final double |
Returns the volume in US fluid ounces. |
final double |
Returns the volume in liters. |
final double |
Returns the volume in milliliters. |
int |
hashCode() |
static final @NonNull Volume |
liters(double value)Creates |
static final @NonNull Volume |
milliliters(double value)Creates |
@NonNull String |
toString() |
Public methods
fluidOuncesUs
public static final @NonNull Volume fluidOuncesUs(double value)
Creates Volume with the specified value in US fluid ounces.
getFluidOuncesUs
public final double getFluidOuncesUs()
Returns the volume in US fluid ounces.
getMilliliters
public final double getMilliliters()
Returns the volume in milliliters.
liters
public static final @NonNull Volume liters(double value)
Creates Volume with the specified value in liters.
milliliters
public static final @NonNull Volume milliliters(double value)
Creates Volume with the specified value in milliliters.