public final class PreferredWidth
extends java.lang.Object
Preferred width can be specified as a percentage, number of points or a special "none/auto" value.
The instances of this class are immutable.
| Modifier and Type | Field and Description |
|---|---|
static PreferredWidth |
AUTO
Returns an instance that represents the "preferred width is not specified" value.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object obj)
Determines whether the specified object is equal in value to the current object.
|
boolean |
equals(PreferredWidth other)
Determines whether the specified PreferredWidth is equal in value to the current PreferredWidth.
|
static PreferredWidth |
fromPercent(double percent)
A creation method that returns a new instance that represents a preferred width specified as a percentage.
|
static PreferredWidth |
fromPoints(double points)
A creation method that returns a new instance that represents a preferred width specified using a number of points.
|
int |
getType()
Gets the unit of measure used for this preferred width value.
|
double |
getValue()
Gets the preferred width value.
|
int |
hashCode() |
java.lang.String |
toString()
Returns a user-friendly string that displays the value of this object.
|
public static PreferredWidth AUTO
public static PreferredWidth fromPercent(double percent)
percent - The value must be from 0 to 100.public static PreferredWidth fromPoints(double points)
points - The value must be from 0 to 22 inches (22 * 72 points).public final int getType()
PreferredWidthType constants.public final double getValue()
getType() property.public final boolean equals(PreferredWidth other)
public final boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic final int hashCode()
hashCode in class java.lang.Objectpublic final java.lang.String toString()
toString in class java.lang.Object