public final class MathBlock extends MathElementBase implements IMathBlock
Specifies an instance of mathematical text that contained within a MathParagraph and starts on its own line. All math zones, including equations, expressions, arrays of equations or expressions, and formulas are represented by math block.
Example:MathBlock mathBlock = new MathBlock();
| Constructor and Description |
|---|
MathBlock()
Initializes a new instance of the MathBlock class.
|
MathBlock(com.aspose.ms.System.Collections.Generic.IGenericEnumerable<IMathElement> mathElements)
Creates a new mathematical block and puts specified elements in it
|
MathBlock(IMathElement mathElement)
Creates a new mathematical block and puts specified element in it
|
| 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.
|
IMathDelimiter |
delimit(char separatorCharacter)
Delimits child elements with separator character (without the brackets)
|
IMathDelimiter |
enclose(char beginningCharacter,
char endingCharacter)
Encloses child elements of this block in specified characters such as parenthesis or another characters as framing
|
IMathDelimiter |
enclose(char beginningCharacter,
char endingCharacter,
char separatorCharacter)
Encloses child elements of this block in specified characters such as parenthesis or another as framing
and delimit with a separator character
|
IMathElement |
get_Item(int index)
Gets or sets IMathElement at the specified index.
|
IMathElement[] |
getChildren()
Get children elements
|
int |
getCount()
Gets the number of child math elements actually contained in the collection.
|
com.aspose.slides.IDOMObject |
getParent_Immediate()
Returns Parent_Immediate object.
|
int |
indexOf(IMathElement item)
Determines the index of a specific math element in collection.
|
void |
insert(int index,
IMathElement item)
Inserts a MathElement into the collection at the specified index.
|
boolean |
isReadOnly()
Returns false because child elements collection can be modified.
|
com.aspose.ms.System.Collections.Generic.IGenericEnumerator<IMathElement> |
iterator()
Returns an enumerator that iterates through the collection.
|
com.aspose.ms.System.Collections.IEnumerator |
iteratorJava()
Returns a java iterator for the entire collection.
|
IMathBlock |
join(IMathElement mathElement)
Joins a mathematical element with this mathematical block
|
IMathBlock |
join(java.lang.String mathText)
Joins a mathematical text with this mathematical block
|
IMathBlock |
joinBlock(IMathBlock other)
Joins another mathematical block with this one
|
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.
|
void |
set_Item(int index,
IMathElement value)
Gets or sets IMathElement at the specified index.
|
IMathArray |
toMathArray()
Puts child elements in a vertical array
|
void |
writeAsMathMl(java.io.OutputStream stream)
Saves content of this
MathBlock as MathML |
accent, asArgumentOfFunction, asArgumentOfFunction, asArgumentOfFunction, asArgumentOfFunction, asArgumentOfFunction, divide, divide, divide, divide, enclose, function, function, group, group, integral, integral, integral, integral, integral, nary, nary, overbar, radical, radical, setLowerLimit, setLowerLimit, setSubscript, setSubscript, setSubSuperscriptOnTheLeft, setSubSuperscriptOnTheLeft, setSubSuperscriptOnTheRight, setSubSuperscriptOnTheRight, setSuperscript, setSuperscript, setUpperLimit, setUpperLimit, toBorderBox, toBorderBox, toBox, underbarequals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaccent, asArgumentOfFunction, asArgumentOfFunction, asArgumentOfFunction, asArgumentOfFunction, asArgumentOfFunction, divide, divide, divide, divide, enclose, function, function, group, group, integral, integral, integral, integral, integral, nary, nary, overbar, radical, radical, setLowerLimit, setLowerLimit, setSubscript, setSubscript, setSubSuperscriptOnTheLeft, setSubSuperscriptOnTheLeft, setSubSuperscriptOnTheRight, setSubSuperscriptOnTheRight, setSuperscript, setSuperscript, setUpperLimit, setUpperLimit, toBorderBox, toBorderBox, toBox, underbarpublic MathBlock()
Initializes a new instance of the MathBlock class.
Example:MathBlock mathBlock = new MathBlock();
public MathBlock(IMathElement mathElement)
Creates a new mathematical block and puts specified element in it
Example:MathBlock mathBlock = new MathBlock(new MathematicalText("x"));
mathElement - The mathematical element to put in the blockpublic MathBlock(com.aspose.ms.System.Collections.Generic.IGenericEnumerable<IMathElement> mathElements)
Creates a new mathematical block and puts specified elements in it
Example:var elems = new IMathElement[2] { new MathematicalText("item1"), new MathematicalText("item2") }; MathBlock mathBlock = new MathBlock(elems);
mathElements - Mathematical elements to put in the blockpublic final int getCount()
Gets the number of child math elements actually contained in the collection.
Read-only int.
Example:MathBlock mathBlock = new MathBlock(new MathematicalText("x")); int count = mathBlock.getCount();
getCount in interface IMathElementCollectionpublic final IMathElement get_Item(int index)
Gets or sets IMathElement at the specified index.
Example:MathBlock mathBlock = new MathBlock(new MathematicalText("x")); IMathElement firstElem = mathBlock.get_Item(0);
get_Item in interface IMathElementCollectionindex - The zero-based index of the itempublic final void set_Item(int index,
IMathElement value)
Gets or sets IMathElement at the specified index.
Example:MathBlock mathBlock = new MathBlock(new MathematicalText("x")); IMathElement firstElem = mathBlock.get_Item(0);
value - The mathematical element.index - The zero-based index of the itempublic final boolean isReadOnly()
Returns false because child elements collection can be modified.
public final IMathElement[] getChildren()
Get children elements
getChildren in interface IMathElementgetChildren in class MathElementBaseIMathElementpublic final com.aspose.slides.IDOMObject getParent_Immediate()
Returns Parent_Immediate object.
Read-only IDOMObject.
getParent_Immediate in class MathElementBasepublic final void add(IMathElement item)
Adds a math element to the end of the collection.
Example:MathBlock mathBlock = new MathBlock(new MathematicalText("x")); mathBlock.add(new MathematicalText("+")); mathBlock.add(new MathRadical(new MathematicalText("x"), new MathematicalText("3")));
add in interface IMathElementCollectionitem - The IMathElement to be added to the end of the collection.public final void clear()
Removes all elements from the collection.
Example:MathBlock mathBlock = new MathBlock(new MathematicalText("x")); mathBlock.clear();
clear in interface IMathElementCollectionpublic final boolean contains(IMathElement item)
Determines whether the collection contains a specific value.
Example:MathBlock mathBlock = new MathBlock(new MathematicalText("x")); MathematicalText plusElement = new MathematicalText("+"); mathBlock.Add(plusElement); mathBlock.Add(new MathRadical(new MathematicalText("x"), new MathematicalText("3"))); boolean contains = mathBlock.Contains(plusElement);
contains in interface IMathElementCollectionitem - The object to locate in the collection.public final void copyTo(IMathElement[] array, int arrayIndex)
Copy to specified array.
Example:MathBlock mathBlock = new MathBlock(new MathematicalText("x")); MathematicalText plusElement = new MathematicalText("+"); mathBlock.add(plusElement); mathBlock.add(new MathRadical(new MathematicalText("x"), new MathematicalText("3"))); IMathElement[] destinationArray = new IMathElement[mathBlock.Count]; mathBlock.copyTo(destinationArray, 0);
copyTo in interface IMathElementCollectionarray - Array to copy to.arrayIndex - Index to begin copying.public final boolean remove(IMathElement item)
Removes the first occurrence of a specific object from the collection.
Example:MathBlock mathBlock = new MathBlock(new MathematicalText("x")); MathematicalText plusElement = new MathematicalText("+"); mathBlock.Add(plusElement); mathBlock.Add(new MathRadical(new MathematicalText("x"), new MathematicalText("3"))); mathBlock.Remove(plusElement);
remove in interface IMathElementCollectionitem - The object to remove from the collection.public final com.aspose.ms.System.Collections.Generic.IGenericEnumerator<IMathElement> iterator()
Returns an enumerator that iterates through the collection.
iterator in interface com.aspose.ms.System.Collections.Generic.IGenericEnumerable<IMathElement>iterator in interface com.aspose.ms.System.Collections.IEnumerable<IMathElement>iterator in interface java.lang.Iterable<IMathElement>IGenericEnumerator that can be used to iterate through the collection.public final com.aspose.ms.System.Collections.IEnumerator iteratorJava()
Returns a java iterator for the entire collection.
Iterator for the entire collection.public final int indexOf(IMathElement item)
Determines the index of a specific math element in collection.
Example:MathBlock mathBlock = new MathBlock(new MathematicalText("x")); MathematicalText plusElement = new MathematicalText("+"); mathBlock.add(plusElement); mathBlock.add(new MathRadical(new MathematicalText("x"), new MathematicalText("3"))); int index = mathBlock.indexOf(plusElement);
indexOf in interface IMathElementCollectionitem - The element to locate in the collection.public final void insert(int index,
IMathElement item)
Inserts a MathElement into the collection at the specified index.
Example:MathBlock mathBlock = new MathBlock(new MathematicalText("x")); MathematicalText plusElement = new MathematicalText("+"); mathBlock.add(plusElement); mathBlock.insert(0, new MathRadical(new MathematicalText("x"), new MathematicalText("3")));
insert in interface IMathElementCollectionindex - The zero-based index at which MathElement should be inserted.item - The MathElement to insert.public final void removeAt(int index)
Removes the element at the specified index of the collection.
Example:MathBlock mathBlock = new MathBlock(new MathematicalText("x")); MathematicalText plusElement = new MathematicalText("+"); mathBlock.add(plusElement); mathBlock.insert(0, new MathRadical(new MathematicalText("x"), new MathematicalText("3"))); mathBlock.removeAt(2);
removeAt in interface IMathElementCollectionindex - The zero-based index of the element to remove.public IMathBlock join(IMathElement mathElement)
Joins a mathematical element with this mathematical block
Example:IMathElement element1 = new MathematicalText("x"); IMathElement element2 = new MathematicalText("y"); IMathBlock block = element1.join(element2);
join in interface IMathElementjoin in class MathElementBasemathElement - The element to be joinedpublic IMathBlock join(java.lang.String mathText)
Joins a mathematical text with this mathematical block
Example:IMathElement element = new MathematicalText("x"); IMathBlock block = element.join("+y");
join in interface IMathElementjoin in class MathElementBasemathText - Mathematical text to be joinedpublic final IMathBlock joinBlock(IMathBlock other)
Joins another mathematical block with this one
Example:IMathBlock block1 = new MathSuperscriptElement(new MathematicalText("c"), new MathematicalText("2")).join(new MathematicalText("=")); IMathBlock block2 = new MathSuperscriptElement(new MathematicalText("a"), new MathematicalText("2")).join(new MathematicalText("+")) .join(new MathSuperscriptElement(new MathematicalText("b"), new MathematicalText("2"))); IMathBlock block3 = block1.joinBlock(block2);
joinBlock in interface IMathBlockother - The joining blockpublic final IMathDelimiter delimit(char separatorCharacter)
Delimits child elements with separator character (without the brackets)
Example:MathBlock mathBlock = new MathematicalText("x").join("y"); IMathDelimiter delimiterElement = mathBlock.delimit('|');
delimit in interface IMathBlockseparatorCharacter - Separator characterIMathDelimiterpublic IMathDelimiter enclose(char beginningCharacter, char endingCharacter)
Encloses child elements of this block in specified characters such as parenthesis or another characters as framing
Example:IMathBlock block = new MathematicalText("x").join("+y"); IMathDelimiter delimiter = block.enclose('[', ']');
enclose in interface IMathElementenclose in class MathElementBasebeginningCharacter - Beginning character (usually left bracket)endingCharacter - Ending character (usually right bracket)IMathDelimiter which includes specified characters as framingpublic final IMathDelimiter enclose(char beginningCharacter, char endingCharacter, char separatorCharacter)
Encloses child elements of this block in specified characters such as parenthesis or another as framing and delimit with a separator character
Example:IMathBlock mathBlock = new MathematicalText("x").join("y"); IMathDelimiter delimiterElement = mathBlock.enclose('{', '}', '%');
enclose in interface IMathBlockbeginningCharacter - Beginning character (usually left bracket)endingCharacter - Ending character (usually right bracket)separatorCharacter - Separator characterIMathDelimiter which includes specified characters as framing and delimiterpublic IMathArray toMathArray()
Puts child elements in a vertical array
Example:IMathArray array = new MathematicalText("x1").join("x2").join("x3").toMathArray();
toMathArray in interface IMathElementtoMathArray in class MathElementBaseIMathArraypublic final void writeAsMathMl(java.io.OutputStream stream)
Saves content of this MathBlock as MathML
writeAsMathMl in interface IMathBlockstream - Target streamCopyright © 2004-2025 Aspose Pty Ltd. All Rights Reserved.