APIdia Launch Partner
Top Description Inners Fields Constructors Methods
javax.swing.text.html

pack-priv Class MuxingAttributeSet

extends Object
implements AttributeSet, Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable, javax.swing.text.AttributeSet
Known Direct Subclasses
javax.swing.text.html.StyleSheet.ViewAttributeSet, javax.swing.text.html.StyleSheet.ResolvedStyle
Annotations
@SuppressWarnings:serial
Imports
java.io.Serializable, java.util.Arrays, .Enumeration, .NoSuchElementException, .Objects, java.util.stream.Collectors, javax.swing.text.AttributeSet, .MutableAttributeSet, .SimpleAttributeSet

An implementation of AttributeSet that can multiplex across a set of AttributeSets.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class
MuxingAttributeSet.MuxingAttributeNameEnumeration

An Enumeration of the Attribute names in a MuxingAttributeSet.

Field Summary

Modifier and TypeField and Description
private AttributeSet[]
attrs

The AttributeSets that make up the resulting AttributeSet.

Constructor Summary

AccessConstructor and Description
public
MuxingAttributeSet(AttributeSet[] attrs)

Creates a MuxingAttributeSet with the passed in attributes.

protected
MuxingAttributeSet()

Creates an empty MuxingAttributeSet.

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

true if the name/value is defined
containsAttribute
(Object
the attribute name
name
,
Object
the attribute value
value
)

Implements javax.swing.text.AttributeSet.containsAttribute.

Checks whether a given attribute name/value is defined.

public boolean

Returns:

true if the element contains all the attributes
containsAttributes
(AttributeSet
the attributes to check
attrs
)

Implements javax.swing.text.AttributeSet.containsAttributes.

Checks whether the attribute set contains all of the given attributes.

public AttributeSet

Returns:

the copy
copyAttributes
()

Implements javax.swing.text.AttributeSet.copyAttributes.

Copies a set of attributes.

public Object

Returns:

the attribute value
getAttribute
(Object
the attribute name
key
)

Implements javax.swing.text.AttributeSet.getAttribute.

Gets the value of an attribute.

public int

Returns:

the number of attributes
getAttributeCount
()

Implements javax.swing.text.AttributeSet.getAttributeCount.

Gets the number of attributes that are defined.

public Enumeration<?>

Returns:

the attribute names
getAttributeNames
()

Implements javax.swing.text.AttributeSet.getAttributeNames.

Gets the names of all attributes.

protected synchronized AttributeSet[]
getAttributes()

Returns the AttributeSets multiplexing too.

public AttributeSet
getResolveParent()

Implements javax.swing.text.AttributeSet.getResolveParent.

Returns null, subclasses may wish to do something more intelligent with this.

protected synchronized void
insertAttributeSetAt(AttributeSet as, int index)

Inserts as at index.

public boolean

Returns:

true if the attribute is defined
isDefined
(Object
the attribute key
key
)

Implements javax.swing.text.AttributeSet.isDefined.

Checks whether a given attribute is defined.

public boolean

Returns:

true if the same
isEqual
(AttributeSet
the attribute set to check against
attr
)

Implements javax.swing.text.AttributeSet.isEqual.

Checks whether two attribute sets are equal.

protected synchronized void
removeAttributeSetAt(int index)

Removes the AttributeSet at index.

protected synchronized void
setAttributes(AttributeSet[] attrs)

Directly sets the AttributeSets that comprise this MuxingAttributeSet.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

attrsback to summary
private AttributeSet[] attrs

The AttributeSets that make up the resulting AttributeSet.

Constructor Detail

MuxingAttributeSetback to summary
public MuxingAttributeSet(AttributeSet[] attrs)

Creates a MuxingAttributeSet with the passed in attributes.

MuxingAttributeSetback to summary
protected MuxingAttributeSet()

Creates an empty MuxingAttributeSet. This is intended for use by subclasses only, and it is also intended that subclasses will set the constituent AttributeSets before invoking any of the AttributeSet methods.

Method Detail

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

Implements javax.swing.text.AttributeSet.containsAttribute.

Checks whether a given attribute name/value is defined.

Parameters
name:Object

the attribute name

value:Object

the attribute value

Returns:boolean

true if the name/value is defined

See Also
AttributeSet#containsAttribute
containsAttributesback to summary
public boolean containsAttributes(AttributeSet attrs)

Implements javax.swing.text.AttributeSet.containsAttributes.

Checks whether the attribute set contains all of the given attributes.

Parameters
attrs:AttributeSet

the attributes to check

Returns:boolean

true if the element contains all the attributes

See Also
AttributeSet#containsAttributes
copyAttributesback to summary
public AttributeSet copyAttributes()

Implements javax.swing.text.AttributeSet.copyAttributes.

Copies a set of attributes.

Returns:AttributeSet

the copy

See Also
AttributeSet#copyAttributes
getAttributeback to summary
public Object getAttribute(Object key)

Implements javax.swing.text.AttributeSet.getAttribute.

Gets the value of an attribute. If the requested attribute is a StyleConstants attribute that has a CSS mapping, the request will be converted.

Parameters
key:Object

the attribute name

Returns:Object

the attribute value

See Also
AttributeSet#getAttribute
getAttributeCountback to summary
public int getAttributeCount()

Implements javax.swing.text.AttributeSet.getAttributeCount.

Gets the number of attributes that are defined.

Returns:int

the number of attributes

See Also
AttributeSet#getAttributeCount
getAttributeNamesback to summary
public Enumeration<?> getAttributeNames()

Implements javax.swing.text.AttributeSet.getAttributeNames.

Gets the names of all attributes.

Returns:Enumeration<?>

the attribute names

See Also
AttributeSet#getAttributeNames
getAttributesback to summary
protected synchronized AttributeSet[] getAttributes()

Returns the AttributeSets multiplexing too. When the AttributeSets need to be referenced, this should be called.

getResolveParentback to summary
public AttributeSet getResolveParent()

Implements javax.swing.text.AttributeSet.getResolveParent.

Returns null, subclasses may wish to do something more intelligent with this.

insertAttributeSetAtback to summary
protected synchronized void insertAttributeSetAt(AttributeSet as, int index)

Inserts as at index. This assumes the value of index is between 0 and attrs.length, inclusive.

isDefinedback to summary
public boolean isDefined(Object key)

Implements javax.swing.text.AttributeSet.isDefined.

Checks whether a given attribute is defined. This will convert the key over to CSS if the key is a StyleConstants key that has a CSS mapping.

Parameters
key:Object

the attribute key

Returns:boolean

true if the attribute is defined

See Also
AttributeSet#isDefined
isEqualback to summary
public boolean isEqual(AttributeSet attr)

Implements javax.swing.text.AttributeSet.isEqual.

Checks whether two attribute sets are equal.

Parameters
attr:AttributeSet

the attribute set to check against

Returns:boolean

true if the same

See Also
AttributeSet#isEqual
removeAttributeSetAtback to summary
protected synchronized void removeAttributeSetAt(int index)

Removes the AttributeSet at index. This assumes the value of index is greater than or equal to 0, and less than attrs.length.

setAttributesback to summary
protected synchronized void setAttributes(AttributeSet[] attrs)

Directly sets the AttributeSets that comprise this MuxingAttributeSet.

javax.swing.text.html back to summary

private Class MuxingAttributeSet.MuxingAttributeNameEnumeration

extends Object
implements Enumeration<Object>
Class Inheritance
  • java.lang.Object
  • javax.swing.text.html.MuxingAttributeSet.MuxingAttributeNameEnumeration
All Implemented Interfaces
java.util.Enumeration

An Enumeration of the Attribute names in a MuxingAttributeSet. This may return the same name more than once.

Field Summary

Modifier and TypeField and Description
private int
attrIndex

Index into attrs the current Enumeration came from.

private Enumeration<?>
currentEnum

Enumeration from attrs.

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public boolean
hasMoreElements()

Implements java.util.Enumeration.hasMoreElements.

Tests if this enumeration contains more elements.

public Object
nextElement()

Implements java.util.Enumeration.nextElement.

Returns the next element of this enumeration if this enumeration object has at least one more element to provide.

pack-priv void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

attrIndexback to summary
private int attrIndex

Index into attrs the current Enumeration came from.

currentEnumback to summary
private Enumeration<?> currentEnum

Enumeration from attrs.

Constructor Detail

MuxingAttributeNameEnumerationback to summary
pack-priv MuxingAttributeNameEnumeration()

Method Detail

hasMoreElementsback to summary
public boolean hasMoreElements()

Implements java.util.Enumeration.hasMoreElements.

Doc from java.util.Enumeration.hasMoreElements.

Tests if this enumeration contains more elements.

nextElementback to summary
public Object nextElement()

Implements java.util.Enumeration.nextElement.

Doc from java.util.Enumeration.nextElement.

Returns the next element of this enumeration if this enumeration object has at least one more element to provide.

updateEnumback to summary
pack-priv void updateEnum()