public class Volume
extends java.lang.Object
Constructor and Description |
---|
Volume() |
Volume(double value,
VolumeUnit units) |
Modifier and Type | Method and Description |
---|---|
Volume |
add(double d) |
Volume |
add(Volume volume) |
int |
compareTo(Volume other) |
static double |
convertToUnits(double value,
VolumeUnit fromUnits,
VolumeUnit toUnits) |
Volume |
convertToUnits(VolumeUnit units) |
Length |
divide(Area area) |
Volume |
divide(double d) |
Area |
divide(Length length) |
double |
divide(Volume volume) |
boolean |
equals(java.lang.Object obj) |
VolumeUnit |
getUnits() |
double |
getValue() |
int |
hashCode() |
Volume |
modulo(Volume volume) |
Volume |
multiply(double d) |
static Volume |
parse(java.lang.String s) |
static Volume |
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 an VolumeUnit value and returns the value as an Volume object.
|
void |
setUnits(VolumeUnit units) |
void |
setValue(double value) |
Volume |
subtract(double d) |
Volume |
subtract(Volume volume) |
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 Volume()
public Volume(double value, VolumeUnit units)
public Volume add(double d)
public Volume subtract(double d)
public Volume multiply(double d)
public Volume divide(double d)
public double divide(Volume volume)
public double getValue()
public void setValue(double value)
public VolumeUnit getUnits()
public void setUnits(VolumeUnit units)
public Volume convertToUnits(VolumeUnit units)
public static double convertToUnits(double value, VolumeUnit fromUnits, VolumeUnit toUnits)
public static Volume parse(java.lang.String s)
public static Volume 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 int compareTo(Volume other)