net.jxta.document
Interface Attributable
- public interface Attributable
- Since:
- JXTA 1.0
- See Also:
Attribute
,
Document
,
Element
Method Summary |
java.lang.String |
addAttribute(Attribute newAttrib)
Adds an attribute with the given name and value. |
java.lang.String |
addAttribute(java.lang.String name,
java.lang.String value)
Adds an attribute with the given name and value. |
Attribute |
getAttribute(java.lang.String name)
Returns a single attribute which matches the name provided. |
java.util.Enumeration |
getAttributes()
Returns an enumerations of the attributes assosicated with this object. |
addAttribute
public java.lang.String addAttribute(java.lang.String name,
java.lang.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 java.lang.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 java.util.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(java.lang.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.