public abstract class Unit extends java.lang.Object implements com.aspose.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.
|
| Modifier | Constructor and Description |
|---|---|
|
Unit(Unit.UnitInit data)
Initializes a new instance of the
Unit class. |
protected |
Unit(UnitType type)
Initializes a new instance of the
Unit class. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.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.
|
java.lang.String |
toString()
Returns a
String that represents this instance. |
protected Unit(UnitType type)
Initializes a new instance of the Unit class.
type - The unit type.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(java.lang.Object obj)
Determines whether the specified Object, is equal to this instance.
equals in interface com.aspose.ms.System.IEquatable<Unit>equals in class java.lang.Objectobj - The Object to compare with this instance.true if the specified Object is equal to this instance; otherwise, false.public int hashCode()
Returns a hash code for this instance.
hashCode in class java.lang.Objectpublic java.lang.String toString()
Returns a String that represents this instance.
toString in class java.lang.ObjectString that represents this instance.