Top Fields Constructors Methods
javax.swing.text.rtf

pack-priv Class MockAttributeSet

extends Object
implements AttributeSet, MutableAttributeSet
Class Inheritance
All Implemented Interfaces
javax.swing.text.MutableAttributeSet, javax.swing.text.AttributeSet
Imports
java.util.Dictionary, .Enumeration, javax.swing.text.AttributeSet, .MutableAttributeSet

Field Summary

Modifier and TypeField and Description
public Dictionary<Object, Object>

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public void
addAttribute(Object
the name
name
,
Object
the value
value
)

Implements javax.swing.text.MutableAttributeSet.addAttribute.

Creates a new attribute set similar to this one except that it contains an attribute with the given name and value.

public void
addAttributes(AttributeSet
the set of attributes
attr
)

Implements javax.swing.text.MutableAttributeSet.addAttributes.

Creates a new attribute set similar to this one except that it contains the given attributes and values.

public boolean
containsAttribute(Object
the non-null attribute name
name
,
Object
the value
value
)

Implements javax.swing.text.AttributeSet.containsAttribute.

Returns true if this set defines an attribute with the same name and an equal value.

public boolean
containsAttributes(AttributeSet
the set of attributes to check against
attr
)

Implements javax.swing.text.AttributeSet.containsAttributes.

Returns true if this set defines all the attributes from the given set with equal values.

public AttributeSet
copyAttributes()

Implements javax.swing.text.AttributeSet.copyAttributes.

Returns an attribute set that is guaranteed not to change over time.

public Object
getAttribute(Object
the non-null key of the attribute binding
name
)

Implements javax.swing.text.AttributeSet.getAttribute.

Fetches the value of the given attribute.

public int
getAttributeCount()

Implements javax.swing.text.AttributeSet.getAttributeCount.

Returns the number of attributes that are defined locally in this set.

public Enumeration<?>
getAttributeNames()

Implements javax.swing.text.AttributeSet.getAttributeNames.

Returns an enumeration over the names of the attributes that are defined locally in the set.

public AttributeSet
getResolveParent()

Implements javax.swing.text.AttributeSet.getResolveParent.

Gets the resolving parent.

public boolean
isDefined(Object
the attribute name
name
)

Implements javax.swing.text.AttributeSet.isDefined.

Checks whether the named attribute has a value specified in the set without resolving through another attribute set.

public boolean
public boolean
isEqual(AttributeSet
an attribute set
attr
)

Implements javax.swing.text.AttributeSet.isEqual.

Determines if the two attribute sets are equivalent.

public void
removeAttribute(Object
the attribute name
name
)

Implements javax.swing.text.MutableAttributeSet.removeAttribute.

Removes an attribute with the given name.

public void
removeAttributes(AttributeSet
the set of attributes
attr
)

Implements javax.swing.text.MutableAttributeSet.removeAttributes.

Removes a set of attributes with the given name.

public void
removeAttributes(Enumeration<?>
the set of names
en
)

Implements javax.swing.text.MutableAttributeSet.removeAttributes.

Removes an attribute set with the given names.

public void
setResolveParent(AttributeSet
the parent
pp
)

Implements javax.swing.text.MutableAttributeSet.setResolveParent.

Sets the resolving parent.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

backingback to summary
public Dictionary<Object, Object> backing

Constructor Detail

MockAttributeSetback to summary
pack-priv MockAttributeSet()

Method Detail

addAttributeback to summary
public void addAttribute(Object name, Object value)

Implements javax.swing.text.MutableAttributeSet.addAttribute.

Doc from javax.swing.text.MutableAttributeSet.addAttribute.

Creates a new attribute set similar to this one except that it contains an attribute with the given name and value. The object must be immutable, or not mutated by any client.

Parameters
name:Object

the name

value:Object

the value

addAttributesback to summary
public void addAttributes(AttributeSet attr)

Implements javax.swing.text.MutableAttributeSet.addAttributes.

Doc from javax.swing.text.MutableAttributeSet.addAttributes.

Creates a new attribute set similar to this one except that it contains the given attributes and values.

Parameters
attr:AttributeSet

the set of attributes

containsAttributeback to summary
public boolean containsAttribute(Object name, Object value)

Implements javax.swing.text.AttributeSet.containsAttribute.

Doc from javax.swing.text.AttributeSet.containsAttribute.

Returns true if this set defines an attribute with the same name and an equal value. If such an attribute is not found locally, it is searched through in the resolving parent hierarchy.

Parameters
name:Object

the non-null attribute name

value:Object

the value

Returns:boolean

true if the set defines the attribute with an equal value, either locally or through its resolving parent

containsAttributesback to summary
public boolean containsAttributes(AttributeSet attr)

Implements javax.swing.text.AttributeSet.containsAttributes.

Doc from javax.swing.text.AttributeSet.containsAttributes.

Returns true if this set defines all the attributes from the given set with equal values. If an attribute is not found locally, it is searched through in the resolving parent hierarchy.

Parameters
attr:AttributeSet

the set of attributes to check against

Returns:boolean

true if this set defines all the attributes with equal values, either locally or through its resolving parent

copyAttributesback to summary
public AttributeSet copyAttributes()

Implements javax.swing.text.AttributeSet.copyAttributes.

Doc from javax.swing.text.AttributeSet.copyAttributes.

Returns an attribute set that is guaranteed not to change over time.

Returns:AttributeSet

a copy of the attribute set

getAttributeback to summary
public Object getAttribute(Object name)

Implements javax.swing.text.AttributeSet.getAttribute.

Doc from javax.swing.text.AttributeSet.getAttribute.

Fetches the value of the given attribute. If the value is not found locally, the search is continued upward through the resolving parent (if one exists) until the value is either found or there are no more parents. If the value is not found, null is returned.

Parameters
name:Object

the non-null key of the attribute binding

Returns:Object

the value of the attribute, or null if not found

getAttributeCountback to summary
public int getAttributeCount()

Implements javax.swing.text.AttributeSet.getAttributeCount.

Doc from javax.swing.text.AttributeSet.getAttributeCount.

Returns the number of attributes that are defined locally in this set. Attributes that are defined in the parent set are not included.

Returns:int

the number of attributes >= 0

getAttributeNamesback to summary
public Enumeration<?> getAttributeNames()

Implements javax.swing.text.AttributeSet.getAttributeNames.

Doc from javax.swing.text.AttributeSet.getAttributeNames.

Returns an enumeration over the names of the attributes that are defined locally in the set. Names of attributes defined in the resolving parent, if any, are not included. The values of the Enumeration may be anything and are not constrained to a particular Object type.

This method never returns null. For a set with no attributes, it returns an empty Enumeration.

Returns:Enumeration<?>

the names

getResolveParentback to summary
public AttributeSet getResolveParent()

Implements javax.swing.text.AttributeSet.getResolveParent.

Doc from javax.swing.text.AttributeSet.getResolveParent.

Gets the resolving parent.

Returns:AttributeSet

the parent

isDefinedback to summary
public boolean isDefined(Object name)

Implements javax.swing.text.AttributeSet.isDefined.

Doc from javax.swing.text.AttributeSet.isDefined.

Checks whether the named attribute has a value specified in the set without resolving through another attribute set.

Parameters
name:Object

the attribute name

Returns:boolean

true if the attribute has a value specified

isEmptyback to summary
public boolean isEmpty()
isEqualback to summary
public boolean isEqual(AttributeSet attr)

Implements javax.swing.text.AttributeSet.isEqual.

Doc from javax.swing.text.AttributeSet.isEqual.

Determines if the two attribute sets are equivalent.

Parameters
attr:AttributeSet

an attribute set

Returns:boolean

true if the sets are equivalent

removeAttributeback to summary
public void removeAttribute(Object name)

Implements javax.swing.text.MutableAttributeSet.removeAttribute.

Doc from javax.swing.text.MutableAttributeSet.removeAttribute.

Removes an attribute with the given name.

Parameters
name:Object

the attribute name

removeAttributesback to summary
public void removeAttributes(AttributeSet attr)

Implements javax.swing.text.MutableAttributeSet.removeAttributes.

Doc from javax.swing.text.MutableAttributeSet.removeAttributes.

Removes a set of attributes with the given name.

Parameters
attr:AttributeSet

the set of attributes

removeAttributesback to summary
public void removeAttributes(Enumeration<?> en)

Implements javax.swing.text.MutableAttributeSet.removeAttributes.

Doc from javax.swing.text.MutableAttributeSet.removeAttributes.

Removes an attribute set with the given names.

Parameters
en:Enumeration<?>

the set of names

setResolveParentback to summary
public void setResolveParent(AttributeSet pp)

Implements javax.swing.text.MutableAttributeSet.setResolveParent.

Doc from javax.swing.text.MutableAttributeSet.setResolveParent.

Sets the resolving parent. This is the set of attributes to resolve through if an attribute isn't defined locally.

Parameters
pp:AttributeSet

the parent