public abstract class Unit extends Object implements com.aspose.html.internal.ms.System.IEquatable<Unit>
Provides the base class for units of measurement.
Modifier and Type | Class and Description |
---|---|
static class |
Unit.UnitInit
Provides dictionary that allows to initialize different unit types.
|
Constructor and Description |
---|
Unit(Unit.UnitInit data)
Initializes a new instance of the
Unit class. |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj)
Determines whether the specified
Object , is equal to this instance. |
boolean |
equals(Unit other)
Determines whether the specified
Unit , is equal to this instance. |
static Length |
fromCentimeters(double value)
Returns a
Length object that is represented in centimeters. |
static Angle |
fromDegrees(double value)
Returns a
Angle object that is represented in degrees. |
static Resolution |
fromDotsPerCentimeters(double value)
Returns a
Resolution object that is represented in dots per centimeters. |
static Resolution |
fromDotsPerInch(double value)
Returns a
Resolution object that is represented in dots per inch. |
static Resolution |
fromDotsPerPixel(double value)
Returns a
Resolution object that is represented in dots per pixels. |
static Angle |
fromGradians(double value)
Returns a
Angle object that is represented in gradians. |
static Frequency |
fromHertz(double value)
Returns a
Frequency object that is represented in hertz. |
static Length |
fromInches(double value)
Returns a
Length object that is represented in inches. |
static Frequency |
fromKiloHertz(double value)
Returns a
Frequency object that is represented in kiloHertz. |
static Length |
fromMillimeters(double value)
Returns a
Length object that is represented in millimeters. |
static Time |
fromMilliseconds(double value)
Returns a
Time object that is represented in milliseconds. |
static Length |
fromPicas(double value)
Returns a
Length object that is represented in picas. |
static Length |
fromPixels(double value)
Returns a
Length object that is represented in pixels. |
static Length |
fromPoints(double value)
Returns a
Length object that is represented in points. |
static Length |
fromQuarterMillimeters(double value)
Returns a
Length object that is represented in quarter-millimeters. |
static Angle |
fromRadians(double value)
Returns a
Angle object that is represented in radians. |
static Time |
fromSeconds(double value)
Returns a
Time object that is represented in seconds. |
static Angle |
fromTurns(double value)
Returns a
Angle object that is represented in turns. |
UnitType |
getUnitType()
Gets the unit type of the
Unit . |
int |
hashCode()
Returns a hash code for this instance.
|
String |
toString()
Returns a
String that represents this instance. |
public Unit(Unit.UnitInit data)
Initializes a new instance of the Unit
class.
data
- The unit type.public static Length fromCentimeters(double value)
Returns a Length
object that is represented in centimeters.
value
- The value.Length
object.public static Length fromMillimeters(double value)
Returns a Length
object that is represented in millimeters.
value
- The value.Length
object.public static Length fromQuarterMillimeters(double value)
Returns a Length
object that is represented in quarter-millimeters.
value
- The value.Length
object.public static Length fromInches(double value)
Returns a Length
object that is represented in inches.
value
- The value.Length
object.public static Length fromPicas(double value)
Returns a Length
object that is represented in picas.
value
- The value.Length
object.public static Length fromPoints(double value)
Returns a Length
object that is represented in points.
value
- The value.Length
object.public static Length fromPixels(double value)
Returns a Length
object that is represented in pixels.
value
- The value.Length
object.public static Angle fromDegrees(double value)
Returns a Angle
object that is represented in degrees.
value
- The value.Angle
object.public static Angle fromGradians(double value)
Returns a Angle
object that is represented in gradians.
value
- The value.Angle
object.public static Angle fromRadians(double value)
Returns a Angle
object that is represented in radians.
value
- The value.Angle
object.public static Angle fromTurns(double value)
Returns a Angle
object that is represented in turns.
value
- The value.Angle
object.public static Time fromSeconds(double value)
Returns a Time
object that is represented in seconds.
value
- The value.Time
object.public static Time fromMilliseconds(double value)
Returns a Time
object that is represented in milliseconds.
value
- The value.Time
object.public static Frequency fromHertz(double value)
Returns a Frequency
object that is represented in hertz.
value
- The value.Frequency
object.public static Frequency fromKiloHertz(double value)
Returns a Frequency
object that is represented in kiloHertz.
value
- The value.Frequency
object.public static Resolution fromDotsPerInch(double value)
Returns a Resolution
object that is represented in dots per inch.
value
- The value.Resolution
object.public static Resolution fromDotsPerCentimeters(double value)
Returns a Resolution
object that is represented in dots per centimeters.
value
- The value.Resolution
object.public static Resolution fromDotsPerPixel(double value)
Returns a Resolution
object that is represented in dots per pixels.
value
- The value.Resolution
object.public UnitType getUnitType()
Gets the unit type of the Unit
.
public boolean equals(Unit other)
Determines whether the specified Unit
, is equal to this instance.
public boolean equals(Object obj)
Determines whether the specified Object
, is equal to this instance.
public int hashCode()
Returns a hash code for this instance.