com.aspose.html.drawing

Class Unit

  • All Implemented Interfaces:
    com.aspose.html.internal.ms.System.IEquatable<Unit>
    Direct Known Subclasses:
    LengthOrAuto, Numeric


    public abstract class Unit
    extends Object
    implements com.aspose.html.internal.ms.System.IEquatable<Unit>

    Provides the base class for units of measurement.

    • Constructor Detail

      • Unit

        public Unit(Unit.UnitInit data)

        Initializes a new instance of the Unit class.

        Parameters:
        data - The unit type.
    • Method Detail

      • fromCentimeters

        public static Length fromCentimeters(double value)

        Returns a Length object that is represented in centimeters.

        Parameters:
        value - The value.
        Returns:
        Returns a Length object.
      • fromMillimeters

        public static Length fromMillimeters(double value)

        Returns a Length object that is represented in millimeters.

        Parameters:
        value - The value.
        Returns:
        Returns a Length object.
      • fromQuarterMillimeters

        public static Length fromQuarterMillimeters(double value)

        Returns a Length object that is represented in quarter-millimeters.

        Parameters:
        value - The value.
        Returns:
        Returns a Length object.
      • fromInches

        public static Length fromInches(double value)

        Returns a Length object that is represented in inches.

        Parameters:
        value - The value.
        Returns:
        Returns a Length object.
      • fromPicas

        public static Length fromPicas(double value)

        Returns a Length object that is represented in picas.

        Parameters:
        value - The value.
        Returns:
        Returns a Length object.
      • fromPoints

        public static Length fromPoints(double value)

        Returns a Length object that is represented in points.

        Parameters:
        value - The value.
        Returns:
        Returns a Length object.
      • fromPixels

        public static Length fromPixels(double value)

        Returns a Length object that is represented in pixels.

        Parameters:
        value - The value.
        Returns:
        Returns a Length object.
      • fromDegrees

        public static Angle fromDegrees(double value)

        Returns a Angle object that is represented in degrees.

        Parameters:
        value - The value.
        Returns:
        Returns a Angle object.
      • fromGradians

        public static Angle fromGradians(double value)

        Returns a Angle object that is represented in gradians.

        Parameters:
        value - The value.
        Returns:
        Returns a Angle object.
      • fromRadians

        public static Angle fromRadians(double value)

        Returns a Angle object that is represented in radians.

        Parameters:
        value - The value.
        Returns:
        Returns a Angle object.
      • fromTurns

        public static Angle fromTurns(double value)

        Returns a Angle object that is represented in turns.

        Parameters:
        value - The value.
        Returns:
        Returns a Angle object.
      • fromSeconds

        public static Time fromSeconds(double value)

        Returns a Time object that is represented in seconds.

        Parameters:
        value - The value.
        Returns:
        Returns a Time object.
      • fromMilliseconds

        public static Time fromMilliseconds(double value)

        Returns a Time object that is represented in milliseconds.

        Parameters:
        value - The value.
        Returns:
        Returns a Time object.
      • fromHertz

        public static Frequency fromHertz(double value)

        Returns a Frequency object that is represented in hertz.

        Parameters:
        value - The value.
        Returns:
        Returns a Frequency object.
      • fromKiloHertz

        public static Frequency fromKiloHertz(double value)

        Returns a Frequency object that is represented in kiloHertz.

        Parameters:
        value - The value.
        Returns:
        Returns a Frequency object.
      • fromDotsPerInch

        public static Resolution fromDotsPerInch(double value)

        Returns a Resolution object that is represented in dots per inch.

        Parameters:
        value - The value.
        Returns:
        Returns a Resolution object.
      • fromDotsPerCentimeters

        public static Resolution fromDotsPerCentimeters(double value)

        Returns a Resolution object that is represented in dots per centimeters.

        Parameters:
        value - The value.
        Returns:
        Returns a Resolution object.
      • fromDotsPerPixel

        public static Resolution fromDotsPerPixel(double value)

        Returns a Resolution object that is represented in dots per pixels.

        Parameters:
        value - The value.
        Returns:
        Returns a Resolution object.
      • getUnitType

        public UnitType getUnitType()

        Gets the unit type of the Unit.

        Value: The type of the unit.
      • equals

        public boolean equals(Unit other)

        Determines whether the specified Unit, is equal to this instance.

        Parameters:
        other - The Unit to compare with this instance.
        Returns:
        true if the specified Unit is equal to this instance; otherwise, false.
      • equals

        public boolean equals(Object obj)

        Determines whether the specified Object, is equal to this instance.

        Specified by:
        equals in interface com.aspose.html.internal.ms.System.IEquatable<Unit>
        Overrides:
        equals in class Object
        Parameters:
        obj - The Object to compare with this instance.
        Returns:
        true if the specified Object is equal to this instance; otherwise, false.
      • hashCode

        public int hashCode()

        Returns a hash code for this instance.

        Overrides:
        hashCode in class Object
        Returns:
        A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.
      • toString

        public String toString()

        Returns a String that represents this instance.

        Overrides:
        toString in class Object
        Returns:
        A String that represents this instance.