ch.randelshofer.media.tiff
Class Rational
java.lang.Object
java.lang.Number
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)
|
| Methods inherited from class java.lang.Number |
byteValue, shortValue |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Rational
public Rational(long numerator,
long denominator)
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