context.arch.enactor
Class EnactorParameter

java.lang.Object
  extended bycontext.arch.enactor.EnactorParameter

public class EnactorParameter
extends java.lang.Object

Defines a parameter for a rule. A parameter has a name, optional description, and a value or set of values. Each parameter value in a set of values will be bound by the enactor with a set of attributes depending upon current widget values. For instance, a parameter signifying a movement level after which to turn on room lights may have an attribute that specifies room name. The parameter can then maintain a set of movement level values scoped to that room name attribute. Currently, parameters or enactors do no management of multiple values themselves, but applications can maintain various sets of attributes and let listeners know about them. This may change in the future with increased system support for parameter sets.

Author:
newbergr

Field Summary
protected  Attributes attsTemplate
           
protected  java.lang.String description
           
protected  Enactor enactor
           
protected  java.lang.String name
           
protected  java.util.ArrayList values
           
 
Constructor Summary
EnactorParameter(java.lang.String nm)
          constructs a parameter with a given name, and no base attributes.
EnactorParameter(java.lang.String nm, Attributes template)
          constructs a parameter with a name and a base set of attributes.
 
Method Summary
 Attributes getAttributesAt(int i)
           
 Attributes getAttributesTemplate()
          returns the base attribute template for this parameter.
 java.lang.String getDescription()
           
 Enactor getEnactor()
           
 java.lang.String getName()
           
 int getNumValues()
           
 java.lang.Object getValueAt(int i)
           
 void setDescription(java.lang.String description)
          sets the description, a sentence that describes the function of this parameter.
 void setEnactor(Enactor r)
           
 void setValue(Attributes atts, java.lang.Object value)
          set a value for the parameter with the given attributes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

enactor

protected Enactor enactor

description

protected java.lang.String description

name

protected java.lang.String name

attsTemplate

protected Attributes attsTemplate

values

protected java.util.ArrayList values
Constructor Detail

EnactorParameter

public EnactorParameter(java.lang.String nm)
constructs a parameter with a given name, and no base attributes.

Parameters:
nm - the name of this parameter

EnactorParameter

public EnactorParameter(java.lang.String nm,
                        Attributes template)
constructs a parameter with a name and a base set of attributes.

Parameters:
nm -
template -
Method Detail

setEnactor

public void setEnactor(Enactor r)

getEnactor

public Enactor getEnactor()

getName

public java.lang.String getName()

getDescription

public java.lang.String getDescription()

setDescription

public void setDescription(java.lang.String description)
sets the description, a sentence that describes the function of this parameter.

Parameters:
description - The description to set

getAttributesTemplate

public Attributes getAttributesTemplate()
returns the base attribute template for this parameter. only attributes contained in the template can be set on the parameter.

Returns:
the attribute template

setValue

public void setValue(Attributes atts,
                     java.lang.Object value)
set a value for the parameter with the given attributes. only attributes that are contained in the attribute template are stored, and the value is stored along with the attribute. TODO: overwrite values with identical attributes

Parameters:
atts -
value -

getNumValues

public int getNumValues()

getAttributesAt

public Attributes getAttributesAt(int i)

getValueAt

public java.lang.Object getValueAt(int i)