javax.swing.text
public abstract class AbstractDocument.AbstractElement extends Object implements Element, MutableAttributeSet, TreeNode, Serializable
Constructor Summary | |
---|---|
AbstractElement(Element p, AttributeSet s)
Creates a new instance of AbstractElement with a
specified parent Element and AttributeSet .
|
Method Summary | |
---|---|
void | addAttribute(Object name, Object value)
Adds an attribute to this element.
|
void | addAttributes(AttributeSet attrs)
Adds a set of attributes to this element.
|
abstract Enumeration | children()
Returns the child nodes of this Element as an
Enumeration of {@link TreeNode}s.
|
boolean | containsAttribute(Object name, Object value)
Returns true if this element contains the specified
attribute.
|
boolean | containsAttributes(AttributeSet attrs)
Returns true if this element contains all of the
specified attributes.
|
AttributeSet | copyAttributes()
Returns a copy of the attributes of this element.
|
void | dump(PrintStream stream, int indent)
Prints diagnostic output to the specified stream.
|
abstract boolean | getAllowsChildren()
Returns true if this AbstractElement
allows children.
|
Object | getAttribute(Object key)
Returns the attribute value with the specified key. |
int | getAttributeCount()
Returns the number of defined attributes in this element.
|
Enumeration<?> | getAttributeNames()
Returns the names of the attributes of this element.
|
AttributeSet | getAttributes()
Returns the attributes of this element.
|
TreeNode | getChildAt(int index)
Returns the child of this AbstractElement at
index .
|
int | getChildCount()
Returns the number of children of this AbstractElement .
|
Document | getDocument()
Returns the {@link Document} to which this element belongs.
|
abstract Element | getElement(int index)
Returns the child element at the specified index .
|
abstract int | getElementCount()
Returns the number of child elements of this element.
|
abstract int | getElementIndex(int offset)
Returns the index of the child element that spans the specified
offset in the document model.
|
abstract int | getEndOffset()
Returns the offset inside the document model that is after the last
character of this element.
|
int | getIndex(TreeNode node)
Returns the index of a given child TreeNode or
-1 if node is not a child of this
AbstractElement .
|
String | getName()
Returns the name of this element.
|
TreeNode | getParent()
Returns the parent TreeNode of this
AbstractElement or null if this element
has no parent.
|
Element | getParentElement()
Returns the parent element of this element.
|
AttributeSet | getResolveParent()
Returns the resolve parent of this element.
|
abstract int | getStartOffset()
Returns the start offset if this element inside the document model.
|
boolean | isDefined(Object attrName)
Returns true if an attribute with the specified name
is defined in this element, false otherwise.
|
boolean | isEqual(AttributeSet attrs)
Returns true if the specified AttributeSet
is equal to this element's AttributeSet , false
otherwise.
|
abstract boolean | isLeaf()
Returns true if this AbstractElement is a
leaf element, false otherwise.
|
void | removeAttribute(Object name)
Removes an attribute from this element.
|
void | removeAttributes(AttributeSet attrs)
Removes a set of attributes from this element.
|
void | removeAttributes(Enumeration<?> names)
Removes a set of attribute from this element.
|
void | setResolveParent(AttributeSet parent)
Sets the parent attribute set against which the element can resolve
attributes that are not defined in itself.
|
AbstractElement
with a
specified parent Element
and AttributeSet
.
Parameters: p the parent of this AbstractElement
s the attributes to be assigned to this
AbstractElement
Parameters: name the name of the attribute to be added value the value of the attribute to be added
Parameters: attrs the attributes to be added to this element
Element
as an
Enumeration
of {@link TreeNode}s.
Returns: the child nodes of this Element
as an
Enumeration
of {@link TreeNode}s
true
if this element contains the specified
attribute.
Parameters: name the name of the attribute to check value the value of the attribute to check
Returns: true
if this element contains the specified
attribute
true
if this element contains all of the
specified attributes.
Parameters: attrs the attributes to check
Returns: true
if this element contains all of the
specified attributes
Returns: a copy of the attributes of this element
Parameters: stream the stream to write to indent the indentation level
true
if this AbstractElement
allows children.
Returns: true
if this AbstractElement
allows children
Parameters: key the key of the requested attribute
Returns: the attribute value for key
of null
if key
is not found locally and cannot be resolved
in this element's resolve parents
Returns: the number of defined attributes in this element
Returns: the names of the attributes of this element
Returns: the attributes of this element
AbstractElement
at
index
.
Parameters: index the position in the child list of the child element to be returned
Returns: the child of this AbstractElement
at
index
AbstractElement
.
Returns: the number of children of this AbstractElement
Returns: the {@link Document} to which this element belongs
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
Returns: the offset inside the document model that is after the last character of this element
TreeNode
or
-1
if node
is not a child of this
AbstractElement
.
Parameters: node the node for which the index is requested
Returns: the index of a given child TreeNode
or
-1
if node
is not a child of this
AbstractElement
Returns: the name of this element
TreeNode
of this
AbstractElement
or null
if this element
has no parent.
Returns: the parent TreeNode
of this
AbstractElement
or null
if this
element has no parent
Returns: the parent element of this element
Returns: the resolve parent of this element
See Also: setResolveParent
Returns: the start offset if this element inside the document model
true
if an attribute with the specified name
is defined in this element, false
otherwise.
Parameters: attrName the name of the requested attributes
Returns: true
if an attribute with the specified name
is defined in this element, false
otherwise
true
if the specified AttributeSet
is equal to this element's AttributeSet
, false
otherwise.
Parameters: attrs the attributes to compare this element to
Returns: true
if the specified AttributeSet
is equal to this element's AttributeSet
,
false
otherwise
true
if this AbstractElement
is a
leaf element, false
otherwise.
Returns: true
if this AbstractElement
is a
leaf element, false
otherwise
Parameters: name the name of the attribute to be removed
Parameters: attrs the attributes to be removed
Parameters: names the names of the attributes to be removed
Parameters: parent the resolve parent to set