MathFraction
Inheritance: java.lang.Object, com.aspose.slides.MathElementBase
All Implemented Interfaces: com.aspose.slides.IMathFraction, com.aspose.slides.IHasControlCharacterProperties
public final class MathFraction extends MathElementBase implements IMathFraction, IHasControlCharacterProperties
Specifies the fraction object, consisting of a numerator and denominator separated by a fraction bar. The fraction bar can be horizontal or diagonal, depending on the fraction properties. The fraction object is also used to represent the stack function, which places one element above another, with no fraction bar.
Example: MathFraction mathFraction = new MathFraction(new MathematicalText("x"), new MathematicalText("y"), MathFractionTypes.Linear);
Constructors
Constructor | Description |
---|---|
MathFraction(IMathElement numerator, IMathElement denominator, int fractionType) | Initializes MathFraction with the specified numerator, denominator and type |
MathFraction(IMathElement numerator, IMathElement denominator) | Initializes a MathFraction of type ‘Bar’ with the specified numerator and denominator |
Methods
Method | Description |
---|---|
getFractionType() | Fraction type Default: Bar |
setFractionType(int value) | Fraction type Default: Bar |
getNumerator() | Numerator |
getDenominator() | Denominator |
getChildren() | Get children elements |
getControlCharacterProperties() | Control Character Properties |
MathFraction(IMathElement numerator, IMathElement denominator, int fractionType)
public MathFraction(IMathElement numerator, IMathElement denominator, int fractionType)
Initializes MathFraction with the specified numerator, denominator and type
Example: MathFraction mathFraction = new MathFraction(new MathematicalText("x"), new MathematicalText("y"), MathFractionTypes.Linear);
Parameters:
Parameter | Type | Description |
---|---|---|
numerator | IMathElement | Numerator |
denominator | IMathElement | Denominator |
fractionType | int | Fraction type |
MathFraction(IMathElement numerator, IMathElement denominator)
public MathFraction(IMathElement numerator, IMathElement denominator)
Initializes a MathFraction of type ‘Bar’ with the specified numerator and denominator
Example: MathFraction mathFraction = new MathFraction(new MathematicalText("x"), new MathematicalText("y"));
Parameters:
Parameter | Type | Description |
---|---|---|
numerator | IMathElement | Numerator |
denominator | IMathElement | Denominator |
getFractionType()
public final int getFractionType()
Fraction type Default: Bar
Example: IMathFraction mathFraction = new MathematicalText("x").divide("y"); mathFraction.setFractionType(MathFractionTypes.Linear);
Returns: int
setFractionType(int value)
public final void setFractionType(int value)
Fraction type Default: Bar
Example: IMathFraction mathFraction = new MathematicalText("x").divide("y"); mathFraction.setFractionType(MathFractionTypes.Linear);
Parameters:
Parameter | Type | Description |
---|---|---|
value | int |
getNumerator()
public final IMathElement getNumerator()
Numerator
Example: IMathFraction mathFraction = new MathematicalText("x").divide("y"); IMathElement numerator = mathFraction.getNumerator();
Returns: IMathElement
getDenominator()
public final IMathElement getDenominator()
Denominator
Example: IMathFraction mathFraction = new MathematicalText("x").divide("y"); IMathElement denominator = mathFraction.getDenominator();
Returns: IMathElement
getChildren()
public final IMathElement[] getChildren()
Get children elements
Returns: com.aspose.slides.IMathElement[]
getControlCharacterProperties()
public final OmmlControlCharacterPPTXUnsupportedProps getControlCharacterProperties()
Control Character Properties
Returns: com.aspose.slides.OmmlControlCharacterPPTXUnsupportedProps