public abstract class BaseElement extends Object implements Element
Modifier and Type | Field and Description |
---|---|
protected AttributeSet |
attrs
Atributes of this element
|
protected BaseDocument |
doc
Reference to document this element is part of
|
static String |
ElementNameAttribute
Element name attribute
|
protected BaseElement |
parent
Parent element
|
Constructor and Description |
---|
BaseElement(BaseDocument doc,
BaseElement parent,
AttributeSet attrs) |
Modifier and Type | Method and Description |
---|---|
AttributeSet |
getAttributes()
Get attributes of this element
|
Document |
getDocument()
Get document this element is part of
|
abstract Element |
getElement(int index)
Get child of this element at specified index
|
abstract int |
getElementCount()
Get number of children of this element
|
abstract int |
getElementIndex(int offset)
Gets the child element index closest to the given offset.
|
abstract Mark |
getEndMark()
Get end mark of this element
|
abstract int |
getEndOffset()
Get end offset of this element
|
String |
getName()
Get element name if defined
|
Element |
getParentElement()
Get parent element
|
abstract Mark |
getStartMark()
Get start mark of this element
|
abstract int |
getStartOffset()
Get start offset of this element
|
abstract boolean |
isLeaf()
Does this element have any children?
|
public static final String ElementNameAttribute
protected BaseDocument doc
protected BaseElement parent
protected AttributeSet attrs
public BaseElement(BaseDocument doc, BaseElement parent, AttributeSet attrs)
public Document getDocument()
getDocument
in interface Element
public Element getParentElement()
getParentElement
in interface Element
public String getName()
public AttributeSet getAttributes()
getAttributes
in interface Element
public abstract int getStartOffset()
getStartOffset
in interface Element
public abstract Mark getStartMark()
public abstract int getEndOffset()
getEndOffset
in interface Element
public abstract Mark getEndMark()
public abstract Element getElement(int index)
getElement
in interface Element
public abstract int getElementIndex(int offset)
getElementIndex
in interface Element
public abstract int getElementCount()
getElementCount
in interface Element