com.groupdocs.metadata

Interfaces

Classes

Exceptions

com.groupdocs.metadata

Class SRational

  • All Implemented Interfaces:
    com.aspose.ms.System.IEquatable<SRational>


    public final class SRational
    extends Object
    implements com.aspose.ms.System.IEquatable<SRational>

    Represents signed rational number.

    • Constructor Summary

      Constructors 
      Constructor and Description
      SRational(int numerator, int denominator)
      Initializes a new instance of the SRational class.
    • Constructor Detail

      • SRational

        public SRational(int numerator,
                 int denominator)

        Initializes a new instance of the SRational class.

        Parameters:
        numerator - The numerator.
        denominator - The denominator.
        Throws:
        com.aspose.ms.System.ArgumentOutOfRangeException - denominator;Denominator should be grater then zero
    • Method Detail

      • getNumerator

        public final int getNumerator()

        Gets numerator.

        Returns:
        The numerator.
      • getDenominator

        public final int getDenominator()

        Gets denominator.

        Returns:
        The denominator.
      • getValue

        public final double getValue()

        Gets actual value represented as double.

        Returns:
        Double value.
      • equals

        public static boolean equals(SRational rational,
                     SRational other)

        Compares pair of SRational.

        Parameters:
        rational - Comparing item.
        other - Other item.
        Returns:
        true if objects are equal; otherwise false.
      • equals

        public final boolean equals(SRational other)

        Indicates whether the current object is equal to another object of the same type.

        Parameters:
        other - An object to compare with this object.
        Returns:
        true if the current object is equal to the other parameter; otherwise, false.
      • equals

        public boolean equals(Object obj)

        Indicates whether the current object is equal to another object of the same type.

        Specified by:
        equals in interface com.aspose.ms.System.IEquatable<SRational>
        Overrides:
        equals in class Object
        Parameters:
        obj - An object to compare with this object.
        Returns:
        true if the current object is equal to the obj parameter; 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 System.String that represents this instance.

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