TiffSRational

Inheritance: java.lang.Object

public class TiffSRational

The tiff rational type.

Constructors

ConstructorDescription
TiffSRational()Initializes a new instance of the TiffSRational class.
TiffSRational(int value)Initializes a new instance of the TiffSRational class.
TiffSRational(int nominator, int denominator)Initializes a new instance of the TiffSRational class.

Fields

FieldDescription
EPSILONThe epsilon for fraction calculation

Methods

MethodDescription
approximateFraction(double value, double epsilon)Approximates the provided value to a fraction.
approximateFraction(double value)Approximates the provided value to a fraction.
approximateFraction(float value, double epsilon)Approximates the provided value to a fraction.
approximateFraction(float value)Approximates the provided value to a fraction.
getDenominator()Gets the denominator.
getNominator()Gets the nominator.
getValue()Gets the float value.
getValueD()Gets the double value.
toString()Returns a System.String that represents this instance.
equals(Object obj)Determines whether the specified Object is equal to this instance.
hashCode()Returns a hash code for this instance.

TiffSRational()

public TiffSRational()

Initializes a new instance of the TiffSRational class.

TiffSRational(int value)

public TiffSRational(int value)

Initializes a new instance of the TiffSRational class.

Parameters:

ParameterTypeDescription
valueintThe nominator value.

TiffSRational(int nominator, int denominator)

public TiffSRational(int nominator, int denominator)

Initializes a new instance of the TiffSRational class.

Parameters:

ParameterTypeDescription
nominatorintThe nominator.
denominatorintThe denominator.

EPSILON

public static final double EPSILON

The epsilon for fraction calculation

approximateFraction(double value, double epsilon)

public static TiffSRational approximateFraction(double value, double epsilon)

Approximates the provided value to a fraction.

Parameters:

ParameterTypeDescription
valuedoubleThe value.
epsilondoubleThe error allowed.

Returns: TiffSRational - A rational number having error less than epsilon.

approximateFraction(double value)

public static TiffSRational approximateFraction(double value)

Approximates the provided value to a fraction.

Parameters:

ParameterTypeDescription
valuedoubleThe value.

Returns: TiffSRational - A rational number having error less than Epsilon.

approximateFraction(float value, double epsilon)

public static TiffSRational approximateFraction(float value, double epsilon)

Approximates the provided value to a fraction.

Parameters:

ParameterTypeDescription
valuefloatThe value.
epsilondoubleThe error allowed.

Returns: TiffSRational - A rational number having error less than epsilon.

approximateFraction(float value)

public static TiffSRational approximateFraction(float value)

Approximates the provided value to a fraction.

Parameters:

ParameterTypeDescription
valuefloatThe value.

Returns: TiffSRational - A rational number having error less than Epsilon.

getDenominator()

public int getDenominator()

Gets the denominator.

Value: The denominator.

Returns: int

getNominator()

public int getNominator()

Gets the nominator.

Value: The nominator.

Returns: int

getValue()

public float getValue()

Gets the float value.

Value: The float value.

Returns: float

getValueD()

public double getValueD()

Gets the double value.

Value: The double value.

Returns: double

toString()

public String toString()

Returns a System.String that represents this instance.

Returns: java.lang.String - A System.String that represents this instance.

equals(Object obj)

public boolean equals(Object obj)

Determines whether the specified Object is equal to this instance.

Parameters:

ParameterTypeDescription
objjava.lang.ObjectThe Object to compare with this instance.

Returns: boolean - true if the specified Object is equal to this instance; otherwise, false.

hashCode()

public int hashCode()

Returns a hash code for this instance.

Returns: int - A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.