Project JXTA

net.jxta.document
Interface Attributable

All Known Subinterfaces:
XMLDocument, XMLElement

public interface Attributable

Interface for name value pairs to be associated with some base object.

See Also:
Attribute, StructuredDocument, Element

Method Summary
 String addAttribute(Attribute newAttrib)
          Adds an attribute with the given name and value.
 String addAttribute(String name, String value)
          Adds an attribute with the given name and value.
 Attribute getAttribute(String name)
          Returns a single attribute which matches the name provided.
 Enumeration getAttributes()
          Returns an enumerations of the attributes assosicated with this object.
 

Method Detail

addAttribute

public String addAttribute(String name,
                           String value)
Adds an attribute with the given name and value. Some implementations may support only a single value for each distinct name. Others may support multiple values for each name. If the value being provided replaces some other value then that value is returned otherwise null is returned.

Parameters:
name - name of the attribute.
value - value for the attribute.
Returns:
String containing previous value for this name if the value is being replaced otherwise null.

addAttribute

public String addAttribute(Attribute newAttrib)
Adds an attribute with the given name and value. Some implementations may support only a single value for each distinct name. Others may support multiple values for each name. If the value being provided replaces some other value then that value is returned otherwise null is returned.

Parameters:
newAttrib - new attribute.
Returns:
String containing previous value for this name if the value is being replaced otherwise null.

getAttributes

public Enumeration getAttributes()
Returns an enumerations of the attributes assosicated with this object. Each element is of type Attribute.

Returns:
Enumeration the attributes associated with this object.

getAttribute

public Attribute getAttribute(String name)
Returns a single attribute which matches the name provided. If no such named attribute exists then null is returned. For impelementations of this interface which support multiple values for each name only the first value will be returned. To access all values for a name you must use getAttributes.

Returns:
Attribute the attributes matching the given name.

JXTA J2SE