com.aspose.slides

Interfaces

Classes

Exceptions

com.aspose.slides

Class MathFraction

  • All Implemented Interfaces:
    IMathElement, IMathFraction


    public final class MathFraction
    extends MathElementBase
    implements IMathFraction

    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);
     
    • Constructor Detail

      • MathFraction

        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:
        numerator - Numerator
        denominator - Denominator
        fractionType - Fraction type
      • MathFraction

        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:
        numerator - Numerator
        denominator - Denominator
    • Method Detail

      • getFractionType

        public final int getFractionType()

        Fraction type Default: Bar


        Example:
         
         IMathFraction mathFraction = new MathematicalText("x").divide("y");
         mathFraction.setFractionType(MathFractionTypes.Linear);
         
        Specified by:
        getFractionType in interface IMathFraction
      • setFractionType

        public final void setFractionType(int value)

        Fraction type Default: Bar


        Example:
         
         IMathFraction mathFraction = new MathematicalText("x").divide("y");
         mathFraction.setFractionType(MathFractionTypes.Linear);
         
        Specified by:
        setFractionType in interface IMathFraction
      • getNumerator

        public final IMathElement getNumerator()

        Numerator


        Example:
         
         IMathFraction mathFraction = new MathematicalText("x").divide("y");
         IMathElement numerator = mathFraction.getNumerator();
         
        Specified by:
        getNumerator in interface IMathFraction
      • getDenominator

        public final IMathElement getDenominator()

        Denominator


        Example:
         
         IMathFraction mathFraction = new MathematicalText("x").divide("y");
         IMathElement denominator = mathFraction.getDenominator();
         
        Specified by:
        getDenominator in interface IMathFraction