nz.ac.waikato.mcennis.rat.graph.descriptors
Class BasicParameter

java.lang.Object
  extended by nz.ac.waikato.mcennis.rat.graph.descriptors.BasicParameter
All Implemented Interfaces:
Parameter, ParameterInternal, SettableParameter
Direct Known Subclasses:
AverageSumParameter, ExponentialDecayParameter

public class BasicParameter
extends java.lang.Object
implements ParameterInternal

Base implementation of all the parameter interfaces.


Constructor Summary
BasicParameter()
          Creates a new instance of BasicParameter
 
Method Summary
 java.lang.String getName()
          Name of this parameter.
 java.lang.Class getType()
          Returns the Class type of the parameter.
 java.lang.Object getValue()
          Returns the current value of this object.
 boolean isStructural()
          Will modification of this parameter cause a structural change in the component that has it?
 void setName(java.lang.String name)
          Sets the name that this parameter will be accessed by
 void setStructural(boolean b)
          Set this as a parameter whose changes means the application structure needs to be rebuilt.
 void setType(java.lang.Class c)
          Sets the Class that this parameter will hold.
 void setValue(java.lang.Object o)
          Set the underlying parameter with the given value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BasicParameter

public BasicParameter()
Creates a new instance of BasicParameter

Method Detail

setName

public void setName(java.lang.String name)
Description copied from interface: ParameterInternal
Sets the name that this parameter will be accessed by

Specified by:
setName in interface ParameterInternal
Parameters:
name - name of the parameter

setStructural

public void setStructural(boolean b)
Description copied from interface: ParameterInternal
Set this as a parameter whose changes means the application structure needs to be rebuilt. This is of primary interest for GUI development knowing whether a parameter modification means that dependancy checks need to be performed again.

Specified by:
setStructural in interface ParameterInternal
Parameters:
b - is a structural parameter or not.

getName

public java.lang.String getName()
Description copied from interface: Parameter
Name of this parameter. Typically, this value in a Properties object sets this parameter

Specified by:
getName in interface Parameter
Returns:
name of this parameter

getType

public java.lang.Class getType()
Description copied from interface: Parameter
Returns the Class type of the parameter.

Specified by:
getType in interface Parameter
Returns:
Class type of the parameter

getValue

public java.lang.Object getValue()
Description copied from interface: Parameter
Returns the current value of this object. Returns null if no value has been set and no default value exists. Typically, a parameter has a default value that will be returned.

Specified by:
getValue in interface Parameter
Returns:
value of this paramter.

isStructural

public boolean isStructural()
Description copied from interface: Parameter
Will modification of this parameter cause a structural change in the component that has it?

Specified by:
isStructural in interface Parameter
Returns:
is a structural parameter.

setValue

public void setValue(java.lang.Object o)
Description copied from interface: SettableParameter
Set the underlying parameter with the given value. May fail if the class is the wrong type

Specified by:
setValue in interface SettableParameter
Parameters:
o - new parameter value

setType

public void setType(java.lang.Class c)
Description copied from interface: ParameterInternal
Sets the Class that this parameter will hold. This restriction can be a hard restriction or a soft contract depending on the implementation.

Specified by:
setType in interface ParameterInternal
Parameters:
c - Class expected for the parameter's value