public final class Length
extends java.lang.Object
implements java.lang.Cloneable
| Constructor and Description |
|---|
Length() |
Length(double absoluteValue)
Initializes a new instance of the
Length class with the specified absolute value. |
Length(double value,
LengthType type)
Initializes a new instance of the
Length class with the specified value and type. |
| Modifier and Type | Method and Description |
|---|---|
java.lang.Object |
clone() |
boolean |
equals(java.lang.Object obj)
Object.equals(java.lang.Object) override. |
double |
getAbsoluteLength(double space)
Calculates the absolute length corresponding to the specified argument,
relative to the the specified area.
|
double |
getAbsoluteLengthF(double space)
Calculates the absolute length corresponding to the specified argument,
relative to the the specified area.
|
LengthType |
getType()
Gets a value indicating how to interpret Value.
|
double |
getValue()
Gets the value representing this length.
|
int |
hashCode()
Gets the hash code for this instance of
Length object. |
static boolean |
op_Equality(Length l1,
Length l2)
Compares two Length objects for equality.
|
static boolean |
op_Inequality(Length l1,
Length l2)
Compares two
Length objects to determine if they are not equal. |
static Length |
op_Subtraction(Length l)
Returns the negative of a specified
Length object. |
void |
setType(LengthType value)
Gets a value indicating how to interpret Value.
|
void |
setValue(double value)
Sets the value representing this length.
|
java.lang.String |
toString()
Returns a string representation of this
Length object. |
public Length()
public Length(double absoluteValue)
Length class with the specified absolute value.absoluteValue - A double specifying absolute length.public Length(double value,
LengthType type)
Length class with the specified value and type.value - A double specifying the initial length value.type - A member of the LengthType enumeration specifying the length type.public java.lang.Object clone()
clone in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
Object.equals(java.lang.Object) override. Compares an object to an instance of Length for equality.equals in class java.lang.Objectobj - The object to compare.public java.lang.String toString()
Length object.toString in class java.lang.ObjectLength.public int hashCode()
Length object.hashCode in class java.lang.ObjectLength.public static boolean op_Inequality(Length l1, Length l2)
Length objects to determine if they are not equal.l1 - The first instance of Length to compare.l2 - The second instance of Length to compare.Length do not have the same
value and LengthType; otherwise, false.public static boolean op_Equality(Length l1, Length l2)
l1 - The first instance of Length to compare.l2 - The second instance of Length to compare.Length have the same value
and LengthType; otherwise, false.public static Length op_Subtraction(Length l)
Length object.l - The instance of Length to process.length.public double getValue()
public void setValue(double value)
public LengthType getType()
public void setType(LengthType value)
public double getAbsoluteLength(double space)
public double getAbsoluteLengthF(double space)