public class Ratio extends com.aspose.ms.lang.Struct<Ratio> implements com.groupdocs.editor.htmlcss.css.datatypes.ICssDataType, com.aspose.ms.System.ICloneable
Represents a "ratio" CSS data type, which is used for describing aspect ratios in media queries and for raster images by denoting the proportion between two unitless values called "numerator" and "denominator". Immutable struct.
Modifier and Type | Field and Description |
---|---|
static Ratio |
Single
Single default ratio 1/1
|
Constructor and Description |
---|
Ratio() |
Modifier and Type | Method and Description |
---|---|
double |
calculate()
Calculates and returns this ratio as a single floating point number
|
Object |
clone() |
Ratio |
Clone() |
void |
CloneTo(Ratio that) |
static Ratio |
create(int numerator,
int denominator)
Creates and returns one Ratio instance from specified numerator and
denominator
|
Ratio |
deepClone()
Returns a full copy of this ratio
|
boolean |
equals(com.groupdocs.editor.htmlcss.css.datatypes.ICssDataType other)
Determines whether this instance is equal with specified ICssDataType
inheritor, which presumably is another "Ratio" instance
|
boolean |
equals(Object other)
Determines whether this instance is equal with specified uncasted object,
which presumably is another "Ratio" instance
|
boolean |
equals(Ratio other)
Determines whether this instance is equal with specified "Ratio" instance
|
static boolean |
equals(Ratio obj1,
Ratio obj2) |
int |
getDenominator()
Returns a denominator of this ratio
|
Ratio |
getInverseRatio()
Generates and returns an inverse (reciprocal) ratio for this ratio
|
int |
getNumerator()
Returns a numerator of this ratio
|
int |
hashCode()
Returns a hashcode for this instance, which cannot be changed during its
lifetime
|
boolean |
isDefault()
Determines whether this ratio has default value or is a "1/1" (Single)
|
static boolean |
op_Equality(Ratio left,
Ratio right)
Compares two ratios and returns a boolean indicating if the two do match.
|
static boolean |
op_Inequality(Ratio left,
Ratio right)
Compares two ratios and returns a boolean indicating if the two do not
match.
|
String |
serializeDefault()
Serializes this ratio to the string and returns it
|
String |
toString()
Returns a string representation of this ratio; same as
"SerializeDefault()"
|
public static final Ratio Single
Single default ratio 1/1
public final double calculate()
Calculates and returns this ratio as a single floating point number
public void CloneTo(Ratio that)
CloneTo
in class com.aspose.ms.System.ValueType<Ratio>
public static Ratio create(int numerator, int denominator)
Creates and returns one Ratio instance from specified numerator and denominator
numerator
- Numerator for the ratio. Should be a strictly positive
integer number.denominator
- Denominator for the ratio. Should be a strictly
positive integer number.public final Ratio deepClone()
Returns a full copy of this ratio
deepClone
in interface com.aspose.ms.System.ICloneable
public final boolean equals(com.groupdocs.editor.htmlcss.css.datatypes.ICssDataType other)
Determines whether this instance is equal with specified ICssDataType inheritor, which presumably is another "Ratio" instance
other
- Other ICssDataType instance, that is presumably of Ratio
type, to check on equality with thispublic boolean equals(Object other)
Determines whether this instance is equal with specified uncasted object, which presumably is another "Ratio" instance
equals
in interface com.aspose.ms.System.IEquatable<com.groupdocs.editor.htmlcss.css.datatypes.ICssDataType>
equals
in class Object
other
- Other System.Object instance, that is presumably of Ratio
type, to check on equality with thispublic final boolean equals(Ratio other)
Determines whether this instance is equal with specified "Ratio" instance
other
- Other Ratio instance to check on equality with thispublic final int getDenominator()
Returns a denominator of this ratio
public final Ratio getInverseRatio()
Generates and returns an inverse (reciprocal) ratio for this ratio
public final int getNumerator()
Returns a numerator of this ratio
public int hashCode()
Returns a hashcode for this instance, which cannot be changed during its lifetime
public final boolean isDefault()
Determines whether this ratio has default value or is a "1/1" (Single)
isDefault
in interface com.groupdocs.editor.htmlcss.css.datatypes.ICssDataType
public static boolean op_Equality(Ratio left, Ratio right)
Compares two ratios and returns a boolean indicating if the two do match.
left
- The first ratio to use.right
- The second ratio to use.public static boolean op_Inequality(Ratio left, Ratio right)
Compares two ratios and returns a boolean indicating if the two do not match.
left
- The first ratio to use.right
- The second ratio to use.public final String serializeDefault()
Serializes this ratio to the string and returns it
serializeDefault
in interface com.groupdocs.editor.htmlcss.css.datatypes.ICssDataType