com.groupdocs.metadata

Interfaces

Classes

Exceptions

com.groupdocs.metadata

Class Rational

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


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

    Represents rational number.

    • Constructor Summary

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

      • Rational

        public Rational(long numerator,
                long denominator)

        Initializes a new instance of the Rational class.

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

      • getNumerator

        public final long getNumerator()

        Gets the numerator.

        Returns:
        The numerator.
      • getDenominator

        public final long getDenominator()

        Gets the denominator.

        Returns:
        The denominator.
      • getValue

        public final double getValue()

        Gets the rational value.

        Returns:
        The rational value.
      • equals

        public static boolean equals(Rational rational,
                     Rational other)

        Compares pair of Rational.

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

        public final boolean equals(Rational 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<Rational>
        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.