net.sf.jolene.html
Class Attributes

java.lang.Object
  extended by net.sf.jolene.html.Attributes
All Implemented Interfaces:
IAttributes, ICollection

public class Attributes
extends java.lang.Object
implements IAttributes

Map wrapper to handle html attributes. It's a case insensitive sorted map.

Author:
Dan Howard

Constructor Summary
Attributes()
           
 
Method Summary
 void clear()
          Clears the attributes.
 java.lang.String getAttribute(java.lang.String key)
          Gets an attribute from the attribute map or NULL if not found.
 boolean hasAttribute(java.lang.String key)
          Indicates whether or not an attribute exists.
 java.util.Set<java.lang.String> keySet()
          Returns the attributes as a Set.
 java.lang.String removeAttribute(java.lang.String key)
          Remove an attribute.
 java.lang.String setAttribute(java.lang.String key, java.lang.String value)
          Sets an attribute.
 java.lang.String toString()
           
 java.util.Collection<java.lang.String> values()
          Returns the attribute values as a Collection.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Attributes

public Attributes()
Method Detail

setAttribute

public java.lang.String setAttribute(java.lang.String key,
                                     java.lang.String value)
Sets an attribute.

Specified by:
setAttribute in interface IAttributes
Parameters:
key - - attribute name
value - - attribute value
Returns:
String

getAttribute

public java.lang.String getAttribute(java.lang.String key)
Gets an attribute from the attribute map or NULL if not found.

Specified by:
getAttribute in interface IAttributes
Parameters:
key - - attribute name
Returns:
String or NULL of key is null or not found

removeAttribute

public java.lang.String removeAttribute(java.lang.String key)
Remove an attribute.

Specified by:
removeAttribute in interface IAttributes
Parameters:
key - - attribute name
Returns:
String

hasAttribute

public boolean hasAttribute(java.lang.String key)
Indicates whether or not an attribute exists.

Specified by:
hasAttribute in interface IAttributes
Parameters:
key - - attribute name
Returns:
boolean

keySet

public java.util.Set<java.lang.String> keySet()
Returns the attributes as a Set.

Specified by:
keySet in interface ICollection
Returns:
Set

values

public java.util.Collection<java.lang.String> values()
Returns the attribute values as a Collection.

Returns:
Collection

clear

public void clear()
Clears the attributes.

Specified by:
clear in interface ICollection

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object