|
Java™ Platform Standard Ed. 6 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Element
Interface to describe a structural piece of a document. It is intended to capture the spirit of an SGML element.
Method Summary | |
---|---|
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. |
String |
getName()
Fetches the name of the element. |
Element |
getParentElement()
Fetches the parent element. |
int |
getStartOffset()
Fetches the offset from the beginning of the document that this element begins at. |
boolean |
isLeaf()
Is this element a leaf element? An element that may have children, even if it currently has no children, would return false . |
Method Detail |
---|
Document getDocument()
Element getParentElement()
null
.
String getName()
AttributeSet getAttributes()
int getStartOffset()
Document
,
AbstractDocument
int getEndOffset()
All the default 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.
Document
,
AbstractDocument
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.
offset
- the specified offset>= 0
int getElementCount()
Element getElement(int index)
index
- the specified index>= 0
boolean isLeaf()
false
.
|
Java™ Platform Standard Ed. 6 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 1993, 2015, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.
Scripting on this page tracks web page traffic, but does not change the content in any way.