Project JXTA

net.jxta.document
Class Attribute

java.lang.Object
  |
  +--net.jxta.document.Attribute

public class Attribute
extends java.lang.Object

A name value pair which is associated with some base object.

Since:
JXTA 1.0
Version:
$Revision: 1.5 $
See Also:
Attributable, StructuredDocument, Element

Constructor Summary
Attribute(Attributable owner, java.lang.String name, java.lang.String value)
          Constructor for a new attribute which is associated with an
Attribute(java.lang.String name, java.lang.String value)
          Constructor for a new attribute which can be added to an Attributable.
 
Method Summary
protected  java.lang.Object clone()
          {@inheritDoc}
 boolean equals(java.lang.Object target)
          {@inheritDoc} The two attributes are the same if they have the same owner, name and value.
 java.lang.String getName()
          Return name of this attribute
 Attributable getOwner()
          Return the Attributable which is the owner of this attribute.
 java.lang.String getValue()
          Return value of this attribute
 int hashCode()
          {@inheritDoc}
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Attribute

public Attribute(java.lang.String name,
                 java.lang.String value)
Constructor for a new attribute which can be added to an Attributable.
Parameters:
name - Name for this attribute.
value - Value for this attribute.
Since:
JXTA 1.0

Attribute

public Attribute(Attributable owner,
                 java.lang.String name,
                 java.lang.String value)
Constructor for a new attribute which is associated with an
Parameters:
owner - The Atrributable owner of this attribute or null.
name - Name for this attribute.
value - Value for this attribute.
Since:
JXTA 1.0
Method Detail

clone

protected java.lang.Object clone()
{@inheritDoc}
Overrides:
clone in class java.lang.Object

equals

public boolean equals(java.lang.Object target)
{@inheritDoc} The two attributes are the same if they have the same owner, name and value.
Overrides:
equals in class java.lang.Object
Parameters:
target - Attribute to be checked with
Returns:
boolean if the attributes are equal otherwise false.
Since:
JXTA 1.0

hashCode

public int hashCode()
{@inheritDoc}
Overrides:
hashCode in class java.lang.Object

getName

public java.lang.String getName()
Return name of this attribute
Returns:
String containing the attribute's name.
Since:
JXTA 1.0

getOwner

public Attributable getOwner()
Return the Attributable which is the owner of this attribute.
Returns:
Attributable object which owns this attribute.
Since:
JXTA 1.0

getValue

public java.lang.String getValue()
Return value of this attribute
Returns:
String containing the attribute's value.
Since:
JXTA 1.0

Project JXTA