org.objectweb.fractal.explorer.attributes
Class AttributeDescriptor

java.lang.Object
  extended by org.objectweb.fractal.explorer.attributes.AttributeDescriptor

public class AttributeDescriptor
extends Object

A class to represent attributes.


Constructor Summary
AttributeDescriptor(String attributeName, Object attributeValue, boolean isMutable)
           
 
Method Summary
 Thread getMonitor()
          Returns the Thread responsible for periodically testing the value of the attribute corresponding to this descriptor.
 String getName()
          Returns the name of the attribute represented by this descriptor.
 Object getValue()
          Returns the value of the attribute represented by this descriptor.
 boolean hasMonitor()
          Tells whether the value of the attribute represented by this descriptor is subject to monitoring, that is whether it is tested periodically for modifications.
 boolean isMutable()
          Tells whether a value of the attribute represented by this descriptor is mutable (can be modified).
 void setMonitor(Thread monitor)
          Sets the monitor of the attribute represented by this descriptor to the Thread passed as this method's parameter.
 void setValue(Object newValue)
          This method allows for the modification of the attribute's value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AttributeDescriptor

public AttributeDescriptor(String attributeName,
                           Object attributeValue,
                           boolean isMutable)
Parameters:
attributeName -
attributeValue -
isMutable -
Method Detail

getName

public String getName()
Returns the name of the attribute represented by this descriptor.

Returns:
attributeName the name of the attribute.

getValue

public Object getValue()
Returns the value of the attribute represented by this descriptor.

Returns:
attributeValue the value of the attribute.

isMutable

public boolean isMutable()
Tells whether a value of the attribute represented by this descriptor is mutable (can be modified).

Returns:
isMutable true if the attribute's value can be modified, false otherwise.

setValue

public void setValue(Object newValue)
This method allows for the modification of the attribute's value.

Parameters:
newValue - new value of the attribute represented by this descriptor.

hasMonitor

public boolean hasMonitor()
Tells whether the value of the attribute represented by this descriptor is subject to monitoring, that is whether it is tested periodically for modifications.

Returns:
true if the attribute represented by this descriptor is subject to monitoring, false otherwise.

setMonitor

public void setMonitor(Thread monitor)
Sets the monitor of the attribute represented by this descriptor to the Thread passed as this method's parameter. The monitor is responsible for periodically testing the value of the attribute represented by this descriptor. The monitor has to be started externally (its start method is not called in this method's body). If a monitor for this descriptor already exists when this method is called, the "old" monitor is stopped and destroyed.

Parameters:
monitor -

getMonitor

public Thread getMonitor()
Returns the Thread responsible for periodically testing the value of the attribute corresponding to this descriptor.

Returns:
monitor the thread responsible for periodically testing the value of the attribute corresponding to this descriptor. null if the monitor does not exist.