at.ac.tuwien.infosys.sm4all.copal.api.util
Class Attribute

java.lang.Object
  extended by at.ac.tuwien.infosys.sm4all.copal.api.util.Attribute

public class Attribute
extends java.lang.Object

Representation of a single attribute. The attribute is uniquely specified with a name and value.

Author:
sanjin

Constructor Summary
Attribute(java.lang.String name, java.lang.String value)
          Create instance of Attribute with specified name and value.
 
Method Summary
 boolean equals(java.lang.Object obj)
          Compares this Attribute to the specified Object.
 java.lang.String getName()
          Returns the name of this Attribute.
 java.lang.String getValue()
          Returns the value of this Attribute.
 int hashCode()
          Returns hash code for this Attribute.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Attribute

public Attribute(java.lang.String name,
                 java.lang.String value)
Create instance of Attribute with specified name and value.

Parameters:
name - the name of the Attribute.
value - the value for this Attribute.
Throws:
java.lang.NullPointerException - if specified name or value is null.
java.lang.IllegalArgumentException - if specified name is an empty or blank string.
Method Detail

getName

public java.lang.String getName()
Returns the name of this Attribute.

Returns:
the name of this Attribute.

getValue

public java.lang.String getValue()
Returns the value of this Attribute.

Returns:
the value of this Attribute.

hashCode

public int hashCode()
Returns hash code for this Attribute. The hash code for an Attribute object is computed as:
 name * 31 + value
 
using integer arithmetic.

Overrides:
hashCode in class java.lang.Object
Returns:
a hash code value for this Attribute.

equals

public boolean equals(java.lang.Object obj)
Compares this Attribute to the specified Object. The result is true if and only if the argument is not null and is an Attribute object that has same name as this Attribute.

Overrides:
equals in class java.lang.Object
Parameters:
obj - the Object to compare this Attribute against.
Returns:
true if Attributes are equal; false otherwise.


Copyright © 2010 Distributed Systems Group, Vienna University of Technology. All Rights Reserved.