All Packages  Class Hierarchy  This Package  Previous  Next  Index  

Class java.awt.swing.text.AbstractDocument.AbstractElement

java.lang.Object
    |
    +----java.awt.swing.text.AbstractDocument.AbstractElement

public abstract class AbstractDocument.AbstractElement
extends Object
implements Element, MutableAttributeSet, Serializable
Implements the abstract part of an element. By default elements support attributes by having a field that represents the immutable part of the current attribute set for the element. The element itself implements MutableAttributeSet which can be used to modify the set by fetching a new immutable set. The immutable sets are provided by the AttributeContext associated with the document.


Constructor Index

 o AbstractDocument.AbstractElement(AbstractDocument, Element, AttributeSet)
Creates a new AbstractElement.

Method Index

 o addAttribute(String, Object)
Adds an attribute to the element.
 o addAttributes(AttributeSet)
Adds a set of attributes to the element.
 o containsAttribute(String, Object)
Checks whether a given attribute name/value is defined.
 o containsAttributes(AttributeSet)
Checks whether the element contains all the attributes.
 o copyAttributes()
Copies a set of attributes.
 o dump(PrintStream, int)
Dumps a debugging representation of the element hierarchy.
 o finalize()
Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.
 o getAttribute(String)
Gets the value of an attribute.
 o getAttributeCount()
Gets the number of attributes that are defined.
 o getAttributeNames()
Gets the names of all attributes.
 o getAttributes()
Gets the attributes for the element.
 o getDocument()
Retrieves the underlying model.
 o getElement(int)
Gets a child element.
 o getElementCount()
Gets the number of children for the element.
 o getElementIndex(int)
Gets the child element index closest to the given model offset.
 o getEndOffset()
Gets the ending offset in the model for the element.
 o getName()
Gets the name of the element.
 o getParentElement()
Gets the parent of the element.
 o getResolveParent()
If not overriden, the resolving parent defaults to the parent element.
 o getStartOffset()
Gets the starting offset in the model for the element.
 o isDefined(String)
Checks whether a given attribute is defined.
 o isEmpty()
Checks whether any attributes have been defined.
 o isEqual(AttributeSet)
Checks whether two attribute sets are equal.
 o isLeaf()
Checks whether the element is a leaf.
 o removeAttribute(String)
Removes an attribute from the set.
 o removeAttributes(AttributeSet)
Removes a set of attributes for the element.
 o removeAttributes(Enumeration)
Removes a set of attributes for the element.
 o setResolveParent(MutableAttributeSet)
Sets the resolving parent.

Constructors

 o AbstractDocument.AbstractElement
public AbstractDocument.AbstractElement(AbstractDocument this$0,
                                        Element parent,
                                        AttributeSet a)
Creates a new AbstractElement.

Parameters:
parent - the parent element
a - the attributes for the element

Methods

 o dump
public void dump(PrintStream out,
                 int indentAmount)
Dumps a debugging representation of the element hierarchy.

Parameters:
out - the output stream
indentAmount - the indentation level
 o finalize
protected void finalize() throws Throwable
Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.

Overrides:
finalize in class Object
 o isEmpty
public boolean isEmpty()
Checks whether any attributes have been defined.

Returns:
true if the attribute list is empty
See Also:
isEmpty
 o getAttributeCount
public int getAttributeCount()
Gets the number of attributes that are defined.

Returns:
the number of attributes
See Also:
getAttributeCount
 o isDefined
public boolean isDefined(String attrName)
Checks whether a given attribute is defined.

Parameters:
attrName - the attribute name
Returns:
true if the attribute is defined
See Also:
isDefined
 o isEqual
public boolean isEqual(AttributeSet attr)
Checks whether two attribute sets are equal.

Parameters:
attr - the attribute set to check against
Returns:
true if the same
See Also:
isEqual
 o copyAttributes
public AttributeSet copyAttributes()
Copies a set of attributes.

Returns:
the copy
See Also:
copyAttributes
 o getAttribute
public Object getAttribute(String attrName)
Gets the value of an attribute.

Parameters:
attrName - the attribute name
Returns:
the attribute value
See Also:
getAttribute
 o getAttributeNames
public Enumeration getAttributeNames()
Gets the names of all attributes.

Returns:
the attribute names
See Also:
getAttributeNames
 o containsAttribute
public boolean containsAttribute(String name,
                                 Object value)
Checks whether a given attribute name/value is defined.

Parameters:
name - the attribute name
value - the attribute value
Returns:
true if the name/value is defined
See Also:
containsAttribute
 o containsAttributes
public boolean containsAttributes(AttributeSet attrs)
Checks whether the element contains all the attributes.

Parameters:
attrs - the attributes to check
Returns:
true if the element contains all the attributes
See Also:
containsAttributes
 o getResolveParent
public AttributeSet getResolveParent()
If not overriden, the resolving parent defaults to the parent element.

Returns:
the attributes from the parent
See Also:
getResolveParent
 o addAttribute
public void addAttribute(String name,
                         Object value)
Adds an attribute to the element.

Parameters:
name - the attribute name
value - the attribute value
See Also:
addAttribute
 o addAttributes
public void addAttributes(AttributeSet attr)
Adds a set of attributes to the element.

Parameters:
attr - the attributes to add
See Also:
addAttribute
 o removeAttribute
public void removeAttribute(String name)
Removes an attribute from the set.

Parameters:
name - the attribute name
See Also:
removeAttribute
 o removeAttributes
public void removeAttributes(Enumeration names)
Removes a set of attributes for the element.

Parameters:
names - the attribute names
See Also:
removeAttributes
 o removeAttributes
public void removeAttributes(AttributeSet attrs)
Removes a set of attributes for the element.

Parameters:
attrs - the attributes
See Also:
removeAttributes
 o setResolveParent
public void setResolveParent(MutableAttributeSet parent)
Sets the resolving parent.

Parameters:
parent - the parent
See Also:
setResolveParent
 o getDocument
public Document getDocument()
Retrieves the underlying model.

Returns:
the model
 o getParentElement
public Element getParentElement()
Gets the parent of the element.

Returns:
the parent
 o getAttributes
public AttributeSet getAttributes()
Gets the attributes for the element.

Returns:
the attribute set
 o getName
public String getName()
Gets the name of the element.

Returns:
the name
 o getStartOffset
public abstract int getStartOffset()
Gets the starting offset in the model for the element.

Returns:
the offset
 o getEndOffset
public abstract int getEndOffset()
Gets the ending offset in the model for the element.

Returns:
the offset
 o getElement
public abstract Element getElement(int index)
Gets a child element.

Parameters:
index - the child index
Returns:
the child element
 o getElementCount
public abstract int getElementCount()
Gets the number of children for the element.

Returns:
the number of children
 o getElementIndex
public abstract int getElementIndex(int offset)
Gets the child element index closest to the given model offset.

Parameters:
offset - the offset
Returns:
the element index
 o isLeaf
public abstract boolean isLeaf()
Checks whether the element is a leaf.

Returns:
true if a leaf

All Packages  Class Hierarchy  This Package  Previous  Next  Index  

Submit a bug or feature