public abstract class FormulaElement extends Object implements Element
Modifier | Constructor and Description |
---|---|
protected |
FormulaElement(FormulaDocument document,
FormulaRootElement parentElement) |
Modifier and Type | Method and Description |
---|---|
AttributeSet |
getAttributes()
Fetches the collection of attributes this element contains.
|
Document |
getDocument()
Fetches the document associated with this element.
|
Element |
getElement(int index)
Fetches the child element at the given index.
|
int |
getElementCount()
Gets the number of child elements contained by this element.
|
int |
getElementIndex(int offset)
Gets the child element index closest to the given offset.
|
int |
getEndOffset()
Fetches the offset from the beginning of the document that this element ends at.
|
Element |
getParentElement()
Fetches the parent element.
|
int |
getStartOffset()
Fetches the offset from the beginning of the document that this element begins at.
|
abstract String |
getText() |
boolean |
isLeaf()
Is this element a leaf element? An element that may have children, even if it currently has no children,
would return
false . |
void |
setEndOffset(int endOffset) |
void |
setStartOffset(int startOffset) |
protected FormulaElement(FormulaDocument document, FormulaRootElement parentElement)
public void setEndOffset(int endOffset)
public void setStartOffset(int startOffset)
public abstract String getText()
public Document getDocument()
getDocument
in interface Element
public Element getParentElement()
null
.getParentElement
in interface Element
public AttributeSet getAttributes()
getAttributes
in interface Element
public int getStartOffset()
getStartOffset
in interface Element
Document
,
AbstractDocument
public int getEndOffset()
Document
implementations descend from AbstractDocument
.
AbstractDocument
models an implied break at the end of the document. As a result of this, it is
possible for this to return a value greater than the length of the document.getEndOffset
in interface Element
Document
,
AbstractDocument
public int getElementIndex(int offset)
-1
if the Element
is a leaf, otherwise returns the index of the
Element
that best represents the given location. Returns 0
if the location is less than
the start offset. Returns getElementCount() - 1
if the location is greater than or equal to the end
offset.getElementIndex
in interface Element
offset
- the specified offset >= 0public int getElementCount()
getElementCount
in interface Element
public Element getElement(int index)
getElement
in interface Element
index
- the specified index >= 0Copyright © 2017 Hitachi Vantara. All rights reserved.