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
|
Modifier and Type | Method and Description |
---|---|
double |
calculate()
Calculates and returns this ratio as a single floating point number
|
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) |
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
|
int |
getDenominator()
Returns a denominator of this ratio
|
Ratio |
getInverseRatio()
Generates and returns an inversed (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 double calculate()
Calculates and returns this ratio as a single floating point number
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 Ratio deepClone()
Returns a full copy of this ratio
deepClone
in interface com.aspose.ms.System.ICloneable
public boolean equals(com.groupdocs.editor.htmlcss.css.datatypes.ICssDataType other)
public boolean equals(Object other)
Determines whether this instance is equal with specified uncasted object, which presumably is another "Ratio" instance
public boolean equals(Ratio other)
Determines whether this instance is equal with specified "Ratio" instance
other
- Ratiopublic int getDenominator()
Returns a denominator of this ratio
public Ratio getInverseRatio()
Generates and returns an inversed (reciprocal) ratio for this ratio
public 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 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 String serializeDefault()
Serializes this ratio to the string and returns it
serializeDefault
in interface com.groupdocs.editor.htmlcss.css.datatypes.ICssDataType
Copyright © 2018. All rights reserved.