Copyright 2011-01-06 Werner Randelshofer

ch.randelshofer.media.tiff
Class Rational

java.lang.Object
  extended by java.lang.Number
      extended by ch.randelshofer.media.tiff.Rational
All Implemented Interfaces:
java.io.Serializable

public class Rational
extends java.lang.Number

Represents a TIFF RATIONAL number.

Two LONGs 32-bit (4-byte) unsigned integer: the first represents the numerator of a fraction; the second, the denominator.

Version:
1.2 2010-09-07 Extends Number instead of Object.
1.1 2010-07-06 Shows decimal value next to the fraction.
1.0 2009-12-27 Created.
Author:
Werner Randelshofer
See Also:
Serialized Form

Constructor Summary
Rational(long numerator, long denominator)
           
 
Method Summary
 double doubleValue()
           
 boolean equals(java.lang.Object obj)
           
 float floatValue()
           
 long getDenominator()
           
 long getNumerator()
           
 int hashCode()
           
 int intValue()
           
 long longValue()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Number
byteValue, shortValue
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Rational

public Rational(long numerator,
                long denominator)
Method Detail

getNumerator

public long getNumerator()

getDenominator

public long getDenominator()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

intValue

public int intValue()
Specified by:
intValue in class java.lang.Number

longValue

public long longValue()
Specified by:
longValue in class java.lang.Number

floatValue

public float floatValue()
Specified by:
floatValue in class java.lang.Number

doubleValue

public double doubleValue()
Specified by:
doubleValue in class java.lang.Number

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

Copyright 2011-01-06 Werner Randelshofer