com.aspose.slides

Interfaces

Classes

Exceptions

com.aspose.slides

Interface IMathElementCollection

  • All Superinterfaces:
    com.aspose.ms.System.Collections.IEnumerable<IMathElement>, com.aspose.ms.System.Collections.Generic.IGenericEnumerable<IMathElement>, java.lang.Iterable<IMathElement>
    All Known Subinterfaces:
    IMathBlock
    All Known Implementing Classes:
    MathBlock


    public interface IMathElementCollection
    extends com.aspose.ms.System.Collections.Generic.IGenericEnumerable<IMathElement>

    Represents a collection of mathematical elements (MathElement).


    Example:
     
     IMathElementCollection collection = new MathBlock();
     
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method and Description
      void add(IMathElement item)
      Adds a math element to the end of the collection.
      void clear()
      Removes all elements from the collection.
      boolean contains(IMathElement item)
      Determines whether the collection contains a specific value.
      void copyTo(IMathElement[] array, int arrayIndex)
      Copy to specified array.
      IMathElement get_Item(int index)
      Gets the element at the specified index.
      int getCount()
      Gets the number of elements actually contained in the collection.
      int indexOf(IMathElement item)
      Determines the index of a specific math element in collection.
      void insert(int index, IMathElement item)
      Inserts a math element into the collection at the specified index.
      boolean remove(IMathElement item)
      Removes the first occurrence of a specific object from the collection.
      void removeAt(int index)
      Removes the element at the specified index of the collection.
      • Methods inherited from interface com.aspose.ms.System.Collections.Generic.IGenericEnumerable

        iterator
      • Methods inherited from interface java.lang.Iterable

        forEach, spliterator
    • Method Detail

      • get_Item

        IMathElement get_Item(int index)

        Gets the element at the specified index. Read-only IMathElement.


        Example:
         
         IMathElementCollection collection = new MathBlock(new MathematicalText("x"));
         IMathElement firstElem = collection.get_Item(0);
         
        Parameters:
        index - The zero-based index of the item to get
      • getCount

        int getCount()

        Gets the number of elements actually contained in the collection. Read-only int.


        Example:
         
         IMathElementCollection collection = new MathBlock(new MathematicalText("x"));
         int count = collection.getCount();
         
      • add

        void add(IMathElement item)

        Adds a math element to the end of the collection.


        Example:
         
         IMathElementCollection collection = new MathBlock(new MathematicalText("x"));
         collection.add(new MathematicalText("+"));
         collection.add(new MathRadical(new MathematicalText("x"), new MathematicalText("3")));
         
        Parameters:
        item - The IMathElement to be added to the end of the collection.
      • indexOf

        int indexOf(IMathElement item)

        Determines the index of a specific math element in collection.


        Example:
         
         IMathElementCollection collection = new MathBlock(new MathematicalText("x"));
         MathematicalText plusElement = new MathematicalText("+");
         collection.add(plusElement);
         collection.add(new MathRadical(new MathematicalText("x"), new MathematicalText("3")));
         int index = collection.indexOf(plusElement);
         
        Parameters:
        item - The element to locate in the collection.
        Returns:
        The index of item if found in the collection; otherwise, -1.
      • insert

        void insert(int index,
                    IMathElement item)

        Inserts a math element into the collection at the specified index.


        Example:
         
         IMathElementCollection collection = new MathBlock(new MathematicalText("x"));
         MathematicalText plusElement = new MathematicalText("+");
         collection.add(plusElement);
         collection.insert(0, new MathRadical(new MathematicalText("x"), new MathematicalText("3")));
         
        Parameters:
        index - The zero-based index at which IMathElement should be inserted.
        item - The IMathElement to insert.
      • clear

        void clear()

        Removes all elements from the collection.


        Example:
         
         IMathElementCollection collection = new MathBlock(new MathematicalText("x"));
         collection.clear();
         
      • contains

        boolean contains(IMathElement item)

        Determines whether the collection contains a specific value.


        Example:
         
         IMathElementCollection collection = new MathBlock(new MathematicalText("x"));
         MathematicalText plusElement = new MathematicalText("+");
         collection.add(plusElement);
         collection.add(new MathRadical(new MathematicalText("x"), new MathematicalText("3")));
         bool contains = collection.contains(plusElement);
         
        Parameters:
        item - The object to locate in the collection.
        Returns:
        true if item is found in the collection; otherwise, false.
      • remove

        boolean remove(IMathElement item)

        Removes the first occurrence of a specific object from the collection.


        Example:
         
         IMathElementCollection collection = new MathBlock(new MathematicalText("x"));
         MathematicalText plusElement = new MathematicalText("+");
         collection.add(plusElement);
         collection.add(new MathRadical(new MathematicalText("x"), new MathematicalText("3")));
         collection.remove(plusElement);
         
        Parameters:
        item - The object to remove from the collection.
        Returns:
        true if item was successfully removed from the collection; otherwise, false. This method also returns false if item is not found in the original collection.
      • removeAt

        void removeAt(int index)

        Removes the element at the specified index of the collection.


        Example:
         
         IMathElementCollection collection = new MathBlock(new MathematicalText("x"));
         MathematicalText plusElement = new MathematicalText("+");
         collection.add(plusElement);
         collection.insert(0, new MathRadical(new MathematicalText("x"), new MathematicalText("3")));
         collection.removeAt(2);
         
        Parameters:
        index - The zero-based index of the element to remove.
      • copyTo

        void copyTo(IMathElement[] array,
                    int arrayIndex)

        Copy to specified array.


        Example:
         
         IMathElementCollection collection = new MathBlock(new MathematicalText("x"));
         MathematicalText plusElement = new MathematicalText("+");
         collection.add(plusElement);
         collection.add(new MathRadical(new MathematicalText("x"), new MathematicalText("3")));
         IMathElement[] destinationArray = new IMathElement[collection.Count];
         collection.copyTo(destinationArray, 0);
         
        Parameters:
        array - Array to copy to.
        arrayIndex - Index to begin copying.