javax.swing.text
public class AbstractDocument.BranchElement extends AbstractDocument.AbstractElement
Elements that contain other Elements.
| Constructor Summary | |
|---|---|
| BranchElement(Element parent, AttributeSet attributes)
Creates a new BranchElement with the specified
parent and attributes.
| |
| Method Summary | |
|---|---|
| Enumeration | children()
Returns the children of this BranchElement.
|
| boolean | getAllowsChildren()
Returns true since BranchElements allow
child elements.
|
| Element | getElement(int index)
Returns the child element at the specified index.
|
| int | getElementCount()
Returns the number of child elements of this element.
|
| int | getElementIndex(int offset)
Returns the index of the child element that spans the specified
offset in the document model.
|
| int | getEndOffset()
Returns the offset inside the document model that is after the last
character of this element.
|
| String | getName()
Returns the name of this element. |
| int | getStartOffset()
Returns the start offset of this element inside the document model.
|
| boolean | isLeaf()
Returns false since BranchElement are no
leafes.
|
| Element | positionToElement(int position)
Returns the Element at the specified Document
offset.
|
| void | replace(int offset, int length, Element[] elements)
Replaces a set of child elements with a new set of child elemens.
|
| String | toString()
Returns a string representation of this element.
|
BranchElement with the specified
parent and attributes.
Parameters: parent the parent element of this BranchElement attributes the attributes to set on this
BranchElement
BranchElement.
Returns: the children of this BranchElement
true since BranchElements allow
child elements.
Returns: true since BranchElements allow
child elements
index.
Parameters: index the index of the requested child element
Returns: the requested element
Returns: the number of child elements of this element
Parameters: offset the offset for which the responsible element is searched
Returns: the index of the child element that spans the specified offset in the document model
NullPointerException.
Returns: the offset inside the document model that is after the last character of this element
Throws: NullPointerException if this branch element has no children
Returns: the name of this element
NullPointerException.
Returns: the start offset of this element inside the document model
Throws: NullPointerException if this branch element has no children and no startOffset value has been cached
false since BranchElement are no
leafes.
Returns: false since BranchElement are no
leafes
Element at the specified Document
offset.
Returns: the Element at the specified Document
offset
See Also: BranchElement
Parameters: offset the start index of the elements to be removed length the number of elements to be removed elements the new elements to be inserted
Returns: a string representation of this element