TiffRational

Inheritance: java.lang.Object

All Implemented Interfaces: com.aspose.ms.System.IEquatable

public final class TiffRational implements System.IEquatable<TiffRational>

Represents a rational number.

Constructors

Constructor Description
TiffRational(long numerator, long denominator) Initializes a new instance of the TiffRational class.

Methods

Method Description
getNumerator() Gets the numerator.
getDenominator() Gets the denominator.
getValue() Gets the rational value.
equals(TiffRational rational, TiffRational other) Compares a pair of TiffRational numbers.
equals(TiffRational other) Indicates whether the current object is equal to another object of the same type.
equals(Object obj) Indicates whether the current object is equal to another object of the same type.
hashCode() Returns a hash code for this instance.
op_Equality(TiffRational left, TiffRational right) Indicates whether two objects of the same type are equal.
op_Inequality(TiffRational left, TiffRational right) Indicates whether two objects of the same type are not equal.
toString() Returns a string that represents this instance.

TiffRational(long numerator, long denominator)

public TiffRational(long numerator, long denominator)

Initializes a new instance of the TiffRational class.

Parameters:

Parameter Type Description
numerator long The numerator.
denominator long The denominator.

getNumerator()

public final long getNumerator()

Gets the numerator.

Returns: long - The numerator.

getDenominator()

public final long getDenominator()

Gets the denominator.

Returns: long - The denominator.

getValue()

public final double getValue()

Gets the rational value.

Returns: double - The rational value.

equals(TiffRational rational, TiffRational other)

public static boolean equals(TiffRational rational, TiffRational other)

Compares a pair of TiffRational numbers.

Parameters:

Parameter Type Description
rational TiffRational A rational number.
other TiffRational Another rational number.

Returns: boolean - true if the objects are equal; otherwise, false .

equals(TiffRational other)

public final boolean equals(TiffRational other)

Indicates whether the current object is equal to another object of the same type.

Parameters:

Parameter Type Description
other TiffRational An object to compare with this object.

Returns: boolean - true if the current object is equal to the other parameter; otherwise, false .

equals(Object obj)

public boolean equals(Object obj)

Indicates whether the current object is equal to another object of the same type.

Parameters:

Parameter Type Description
obj java.lang.Object An object to compare with this object.

Returns: boolean - true if the current object is equal to the obj parameter; 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.

op_Equality(TiffRational left, TiffRational right)

public static boolean op_Equality(TiffRational left, TiffRational right)

Indicates whether two objects of the same type are equal.

Parameters:

Parameter Type Description
left TiffRational The left object.
right TiffRational The rigt object.

Returns: boolean - True if the objects are equal; otherwise, false.

op_Inequality(TiffRational left, TiffRational right)

public static boolean op_Inequality(TiffRational left, TiffRational right)

Indicates whether two objects of the same type are not equal.

Parameters:

Parameter Type Description
left TiffRational The left object.
right TiffRational The right object.

Returns: boolean - True if the objects are not equal; otherwise, false.

toString()

public String toString()

Returns a string that represents this instance.

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