org.apache.maven.doxia.sink
Class SinkEventAttributeSet

java.lang.Object
  extended by org.apache.maven.doxia.sink.SinkEventAttributeSet
All Implemented Interfaces:
Cloneable, AttributeSet, MutableAttributeSet, SinkEventAttributes

public class SinkEventAttributeSet
extends Object
implements SinkEventAttributes, Cloneable

Implementation of MutableAttributeSet using a LinkedHashMap.

Since:
1.1
Version:
$Id: SinkEventAttributeSet.java 1185112 2011-10-17 11:33:00Z ltheussl $
Author:
ltheussl

Nested Class Summary
 
Nested classes/interfaces inherited from interface javax.swing.text.AttributeSet
AttributeSet.CharacterAttribute, AttributeSet.ColorAttribute, AttributeSet.FontAttribute, AttributeSet.ParagraphAttribute
 
Field Summary
static SinkEventAttributes BOLD
          An unmodifiable attribute set containing only a bold attribute.
static SinkEventAttributes BOXED
          An unmodifiable attribute set containing only a boxed attribute.
static SinkEventAttributes CENTER
          An unmodifiable attribute set containing only a center attribute.
static SinkEventAttributes ITALIC
          An unmodifiable attribute set containing only an italic attribute.
static SinkEventAttributes JUSTIFY
          An unmodifiable attribute set containing only a justify attribute.
static SinkEventAttributes LEFT
          An unmodifiable attribute set containing only a left attribute.
static SinkEventAttributes LINETHROUGH
          An unmodifiable attribute set containing only a linethrough attribute.
static SinkEventAttributes MONOSPACED
          An unmodifiable attribute set containing only a monospaced attribute.
static SinkEventAttributes OVERLINE
          An unmodifiable attribute set containing only an overline attribute.
static SinkEventAttributes RIGHT
          An unmodifiable attribute set containing only a right attribute.
static SinkEventAttributes UNDERLINE
          An unmodifiable attribute set containing only an underline attribute.
 
Fields inherited from interface org.apache.maven.doxia.sink.SinkEventAttributes
ABBRV, ALIGN, ALT, AXIS, BGCOLOR, BORDER, CELLPADDING, CELLSPACING, CHARSET, CLASS, COLSPAN, COORDS, DECORATION, EMAIL, FRAME, HEADERS, HEIGHT, HREF, HREFLANG, HSPACE, ID, ISMAP, LANG, NAME, NOSHADE, NOWRAP, PROFILE, REL, REV, ROWSPAN, RULES, SCOPE, SHAPE, SIZE, SRC, STYLE, SUMMARY, TARGET, TITLE, TYPE, USEMAP, VALIGN, WIDTH, VSPACE
 
Fields inherited from interface javax.swing.text.AttributeSet
NameAttribute, ResolveAttribute
 
Constructor Summary
SinkEventAttributeSet()
          Constructs a new, empty SinkEventAttributeSet with default size 5.
SinkEventAttributeSet(AttributeSet attributes)
          Constructs a new SinkEventAttributeSet with the same attribute name-value mappings as in the specified AttributeSet.
SinkEventAttributeSet(int size)
          Constructs a new, empty SinkEventAttributeSet with the specified initial size.
SinkEventAttributeSet(String[] attributes)
          Constructs a new SinkEventAttributeSet with the attribute name-value mappings as given by the specified String array.
 
Method Summary
 void addAttribute(Object name, Object value)
           Adds an attribute with the given name and value.
 void addAttributes(AttributeSet attributes)
          
 Object clone()
          
 boolean containsAttribute(Object name, Object value)
          
 boolean containsAttributes(AttributeSet attributes)
          
 AttributeSet copyAttributes()
          
 boolean equals(Object obj)
          
 Object getAttribute(Object key)
          
 int getAttributeCount()
          
 Enumeration<String> getAttributeNames()
          
 AttributeSet getResolveParent()
          
 int hashCode()
          
 boolean isDefined(Object attrName)
          
 boolean isEmpty()
          Checks whether the set of attribs is empty.
 boolean isEqual(AttributeSet attr)
          
 void removeAttribute(Object name)
          
 void removeAttributes(AttributeSet attributes)
          
 void removeAttributes(Enumeration<?> names)
          
 void setResolveParent(AttributeSet parent)
          
 String toString()
          
 SinkEventAttributeSet unmodifiable()
          Replace this AttributeSet by an unmodifiable view of itself.
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

UNDERLINE

public static final SinkEventAttributes UNDERLINE
An unmodifiable attribute set containing only an underline attribute.


OVERLINE

public static final SinkEventAttributes OVERLINE
An unmodifiable attribute set containing only an overline attribute.


LINETHROUGH

public static final SinkEventAttributes LINETHROUGH
An unmodifiable attribute set containing only a linethrough attribute.


BOXED

public static final SinkEventAttributes BOXED
An unmodifiable attribute set containing only a boxed attribute.


BOLD

public static final SinkEventAttributes BOLD
An unmodifiable attribute set containing only a bold attribute.


ITALIC

public static final SinkEventAttributes ITALIC
An unmodifiable attribute set containing only an italic attribute.


MONOSPACED

public static final SinkEventAttributes MONOSPACED
An unmodifiable attribute set containing only a monospaced attribute.


LEFT

public static final SinkEventAttributes LEFT
An unmodifiable attribute set containing only a left attribute.


RIGHT

public static final SinkEventAttributes RIGHT
An unmodifiable attribute set containing only a right attribute.


CENTER

public static final SinkEventAttributes CENTER
An unmodifiable attribute set containing only a center attribute.


JUSTIFY

public static final SinkEventAttributes JUSTIFY
An unmodifiable attribute set containing only a justify attribute.

Constructor Detail

SinkEventAttributeSet

public SinkEventAttributeSet()
Constructs a new, empty SinkEventAttributeSet with default size 5.


SinkEventAttributeSet

public SinkEventAttributeSet(int size)
Constructs a new, empty SinkEventAttributeSet with the specified initial size.

Parameters:
size - the initial number of attribs.

SinkEventAttributeSet

public SinkEventAttributeSet(String[] attributes)
Constructs a new SinkEventAttributeSet with the attribute name-value mappings as given by the specified String array.

Parameters:
attributes - the specified String array. If the length of this array is not an even number, an IllegalArgumentException is thrown.

SinkEventAttributeSet

public SinkEventAttributeSet(AttributeSet attributes)
Constructs a new SinkEventAttributeSet with the same attribute name-value mappings as in the specified AttributeSet.

Parameters:
attributes - the specified AttributeSet.
Method Detail

unmodifiable

public SinkEventAttributeSet unmodifiable()
Replace this AttributeSet by an unmodifiable view of itself. Any subsequent attempt to add, remove or modify the underlying mapping will result in an UnsupportedOperationException.

Returns:
an unmodifiable view of this AttributeSet.
Since:
1.1.1

isEmpty

public boolean isEmpty()
Checks whether the set of attribs is empty.

Returns:
true if the set is empty.

getAttributeCount

public int getAttributeCount()

Specified by:
getAttributeCount in interface AttributeSet

isDefined

public boolean isDefined(Object attrName)

Specified by:
isDefined in interface AttributeSet

isEqual

public boolean isEqual(AttributeSet attr)

Specified by:
isEqual in interface AttributeSet

copyAttributes

public AttributeSet copyAttributes()

Specified by:
copyAttributes in interface AttributeSet

getAttributeNames

public Enumeration<String> getAttributeNames()

Specified by:
getAttributeNames in interface AttributeSet

getAttribute

public Object getAttribute(Object key)

Specified by:
getAttribute in interface AttributeSet

containsAttribute

public boolean containsAttribute(Object name,
                                 Object value)

Specified by:
containsAttribute in interface AttributeSet

containsAttributes

public boolean containsAttributes(AttributeSet attributes)

Specified by:
containsAttributes in interface AttributeSet

addAttribute

public void addAttribute(Object name,
                         Object value)
Adds an attribute with the given name and value.

Specified by:
addAttribute in interface MutableAttributeSet

addAttributes

public void addAttributes(AttributeSet attributes)

Specified by:
addAttributes in interface MutableAttributeSet

removeAttribute

public void removeAttribute(Object name)

Specified by:
removeAttribute in interface MutableAttributeSet

removeAttributes

public void removeAttributes(Enumeration<?> names)

Specified by:
removeAttributes in interface MutableAttributeSet

removeAttributes

public void removeAttributes(AttributeSet attributes)

Specified by:
removeAttributes in interface MutableAttributeSet

getResolveParent

public AttributeSet getResolveParent()

Specified by:
getResolveParent in interface AttributeSet

setResolveParent

public void setResolveParent(AttributeSet parent)

Specified by:
setResolveParent in interface MutableAttributeSet

clone

public Object clone()

Overrides:
clone in class Object

hashCode

public int hashCode()

Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)

Overrides:
equals in class Object

toString

public String toString()

Overrides:
toString in class Object


Copyright © 2005-2012 The Apache Software Foundation. All Rights Reserved.