Class Rational

  • All Implemented Interfaces:

    
    public class Rational
    
                        

    The rational data type of EXIF tag. Contains a pair of longs representing the numerator and denominator of a Rational number.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
      Rational(long nominator, long denominator) Create a Rational with a given numerator and denominator.
      Rational(Rational r) Create a copy of a Rational.
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      long getNumerator() Gets the numerator of the rational.
      long getDenominator() Gets the denominator of the rational
      double toDouble() Gets the rational value as type double.
      boolean equals(Object obj)
      String toString()
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Rational

        Rational(long nominator, long denominator)
        Create a Rational with a given numerator and denominator.
      • Rational

        Rational(Rational r)
        Create a copy of a Rational.
    • Method Detail

      • getNumerator

         long getNumerator()

        Gets the numerator of the rational.

      • getDenominator

         long getDenominator()

        Gets the denominator of the rational

      • toDouble

         double toDouble()

        Gets the rational value as type double. Will cause a divide-by-zero error if the denominator is 0.