org.almendra.commons
Class TAttribute

java.lang.Object
  extended by org.almendra.commons.TAttribute

public class TAttribute
extends java.lang.Object

Trait that implements a class to which user-defined attributes can be added at runtime. For a further introduction into traits see http://www.iam.unibe.ch/~scg/Research/Traits/

Author:
Oliver Plohmann

Field Summary
protected  java.util.Map attributes
          Map that holds values of attributes for a given key.
 
Constructor Summary
TAttribute()
          Creates a new TAttribute object.
 
Method Summary
 java.lang.Object getAttributeValue(java.lang.String attributeName)
          Return the value of the attribute.
 boolean hasAttribute(java.lang.String attributeName)
          Answer whether an attribute with a given name is defined.
 void setAttributeValue(java.lang.String attributeName, java.lang.Object value)
          Set the value of an attribute.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

attributes

protected java.util.Map attributes
Map that holds values of attributes for a given key.

Constructor Detail

TAttribute

public TAttribute()
Creates a new TAttribute object.

Method Detail

setAttributeValue

public void setAttributeValue(java.lang.String attributeName,
                              java.lang.Object value)
Set the value of an attribute.

Parameters:
attributeName - the name of the attribute
value - the value to be set

getAttributeValue

public java.lang.Object getAttributeValue(java.lang.String attributeName)
Return the value of the attribute.

Parameters:
attributeName -
Returns:
the attribute value

hasAttribute

public boolean hasAttribute(java.lang.String attributeName)
Answer whether an attribute with a given name is defined.

Parameters:
attributeName -
Returns: