|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectedu.harvard.hul.ois.jhove.Rational
public class Rational
This class encapsulates a number which is defined as the ratio of two 32-bit unsigned integers, in accordance with the TIFF specification.
| Constructor Summary | |
|---|---|
Rational(int numerator,
int denominator)
The arguments to the int constructor are treated as 32-bit unsigned integers. |
|
Rational(long numerator,
long denominator)
The arguments to this constructor are long in order to represent all possible 32-bit unsigned integers. |
|
| Method Summary | |
|---|---|
long |
getDenominator()
Returns the Denominator property. |
long |
getNumerator()
Returns the Numerator property. |
double |
toDouble()
Converts to a floating-point value (numerator/denominator). |
long |
toLong()
Converts to a long value (numerator/denominator). |
java.lang.String |
toString()
Represents the Rational as a String in the form of "numerator/denominator". |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Rational(long numerator,
long denominator)
numerator - numerator of the Rational valuedenominator - denominator of the Rational value
public Rational(int numerator,
int denominator)
numerator - numerator of the Rational valuedenominator - denominator of the Rational value| Method Detail |
|---|
public long getNumerator()
public long getDenominator()
public double toDouble()
public long toLong()
public java.lang.String toString()
toString in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||