All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class uhr.core.attract.AttributeStd

java.lang.Object
   |
   +----uhr.core.attract.AttributeStd

public class AttributeStd
extends Object
implements Attribute
An Attribute describes a single behavior characteristic of a service. A collection of Attributes describes the behavior of a service offering or need. The advantage to using Attributes is they allow an easy service offering and need matching mechanism. Thus Attributes lie at the heart of the Attractor Pattern used to match host services to client service needs.

An Attribute is immutable.


Constructor Index

 o AttributeStd(String, Object)
Creates a new immutable Attribute.

Method Index

 o equals(Object)
Overrides the method in Object for use in matching.
 o getName()
Returns the attribute name.
 o getValue()
Returns the attribute value.
 o toString()
Overrides the method in Object for use in debugging and such.

Constructors

 o AttributeStd
 public AttributeStd(String name,
                     Object value)
Creates a new immutable Attribute.

Parameters:
name - the name, which cannot be null since the name is the Attribute identifier.
value - the value, which cannot be null.
Throws: IllegalArgumentException
if either argument is null.

Methods

 o equals
 public boolean equals(Object object)
Overrides the method in Object for use in matching.

Parameters:
object - the object to compare to.
Returns:
true if equal or false if not.
Overrides:
equals in class Object
 o toString
 public String toString()
Overrides the method in Object for use in debugging and such.

Returns:
the string representation, which is the name and value.
Overrides:
toString in class Object
 o getName
 public String getName()
Returns the attribute name. This is semantically descriptive but is really just a unique id per attractor. The name is never null.

Returns:
the attribute name.
 o getValue
 public Object getValue()
Returns the attribute value. If the value equals() the value in another attribute with the same name, the attributes match. A value equalivent to "all" matches all other values. The value may not be null, because nulls introduce too much complexity and null is not necessary.

Returns:
the attribute value, which is never null.

All Packages  Class Hierarchy  This Package  Previous  Next  Index