All Packages  Class Hierarchy  This Package  Previous  Next  Index

Interface com.sun.java.swing.text.Element

public interface Element
Interface to describe a structural piece of a document. It is intended to capture the spirit of an SGML element.


Method Index

 o getAttributes()
Fetches the collection of attributes this element contains.
 o getDocument()
Fetches the document associated with this element.
 o getElement(int)
Fetches the child element at the given index.
 o getElementCount()
Gets the number of child elements contained by this element.
 o getElementIndex(int)
Gets the child element index closest to the given offset.
 o getEndOffset()
Fetches the offset from the beginning of the document that this element ends at.
 o getName()
Fetches the name of the element.
 o getParentElement()
Fetches the parent element.
 o getStartOffset()
Fetches the offset from the beginning of the document that this element begins at.
 o isLeaf()
Is this element a leaf element?

Methods

 o getDocument
 public abstract Document getDocument()
Fetches the document associated with this element.

Returns:
the document
 o getParentElement
 public abstract Element getParentElement()
Fetches the parent element. If the element is a root level element returns null.

Returns:
the parent element
 o getName
 public abstract String getName()
Fetches the name of the element. If the element is used to represent some type of structure, this would be the type name.

Returns:
the element name
 o getAttributes
 public abstract AttributeSet getAttributes()
Fetches the collection of attributes this element contains.

Returns:
the attributes for the element
 o getStartOffset
 public abstract int getStartOffset()
Fetches the offset from the beginning of the document that this element begins at. If this element has children, this will be the offset of the first child.

Returns:
the starting offset
 o getEndOffset
 public abstract int getEndOffset()
Fetches the offset from the beginning of the document that this element ends at. If this element has children, this will be the end offset of the last child.

Returns:
the ending offset
 o getElementIndex
 public abstract int getElementIndex(int offset)
Gets the child element index closest to the given offset. The offset is specified relative to the begining of the document.

Parameters:
offset - the specified offset
Returns:
the element index
 o getElementCount
 public abstract int getElementCount()
Gets the number of child elements contained by this element. If this element is a leaf, a count of zero is returned.

Returns:
the number of child elements
 o getElement
 public abstract Element getElement(int index)
Fetches the child element at the given index.

Parameters:
index - the specified index
Returns:
the child element
 o isLeaf
 public abstract boolean isLeaf()
Is this element a leaf element?

Returns:
true if a leaf element else false

All Packages  Class Hierarchy  This Package  Previous  Next  Index