| Constructor and Description |
|---|
Measure(double amount)
Initializes a new instance of the
Measure class. |
Measure(double amount,
MeasureUnit unit)
Initializes a new instance of the
Measure class. |
Measure(java.lang.String value)
Initializes a new instance of the
Measure class. |
Measure(java.lang.String value,
java.util.Locale locale)
Initializes a new instance of the
Measure class. |
| Modifier and Type | Method and Description |
|---|---|
Measure |
convertTo(MeasureUnit targetUnit,
java.lang.Object context)
Converts the amount represented by the current object to the specified unit.
|
boolean |
equals(java.lang.Object obj) |
double |
getAmount()
Gets the amount represented by the current object.
|
MeasureUnit |
getUnit()
Gets the unit of measure of the current object.
|
int |
hashCode() |
boolean |
isEqualTo(Measure other)
Determines whether the specified measure is equal to the current measure.
|
static Measure |
op_Addition(Measure measure,
double value)
Adds the specified amount to the specified
Measure object. |
static Measure |
op_Division(Measure measure,
double value)
Divides the specified amount from the specified
Measure object. |
static Measure |
op_Multiply(Measure measure,
double value)
Multiplies the specified amount to the specified
Measure object. |
static Measure |
op_Subtraction(Measure measure,
double value)
Subtracts the specified amount from the specified
Measure object. |
static Measure |
pixel(double value)
Creates a
Measure instance of the MeasureUnit.Pixel unit from the specified double value. |
static Measure |
point(double value)
Creates a
Measure instance of the MeasureUnit.Point unit from the specified double value. |
java.lang.String |
toString() |
java.lang.String |
toString(java.util.Locale locale)
Returns a string representation of the current measure.
|
public Measure(double amount)
Measure class.amount - The number of pixels represented by the new object.public Measure(double amount,
MeasureUnit unit)
Measure class.amount - The amount represented by the new object.unit - The measure unit of the new object.public Measure(java.lang.String value)
Measure class.value - A string representing the amount and, optionally, units of measure.public Measure(java.lang.String value,
java.util.Locale locale)
Measure class.value - A string representing the amount and, optionally, units of measure.provider - An IFormatProvider object that is used to interpret the specified value.public java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String toString(java.util.Locale locale)
provider - An IFormatProvider object that is used to format the amount.public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectobj - The object to compare to this measure.true if the specified object is a Measure equal
to this object; otherwise, false.public boolean isEqualTo(Measure other)
isEqualTo in interface com.mindfusion.common.Equatable<Measure>other - The object to compare to this measure.true if the specified measure is equal to this object; otherwise, false.public int hashCode()
hashCode in class java.lang.Objectpublic static Measure op_Addition(Measure measure, double value)
Measure object.public static Measure op_Subtraction(Measure measure, double value)
Measure object.public static Measure op_Multiply(Measure measure, double value)
Measure object.public static Measure op_Division(Measure measure, double value)
Measure object.public Measure convertTo(MeasureUnit targetUnit, java.lang.Object context)
targetUnit - A MeasureUnit object representing the unit to convert to.context - Used when converting between logical and device units; otherwise this parameter is ignored.Measure object that represents the original amount in the specified unit.public MeasureUnit getUnit()
public double getAmount()
public static Measure pixel(double value)
Measure instance of the MeasureUnit.Pixel unit from the specified double value.value - The amount represented by the new object.Measure object representing the specified double value.public static Measure point(double value)
Measure instance of the MeasureUnit.Point unit from the specified double value.value - The amount represented by the new object.Measure object representing the specified double value.