org.processmining.models.graphbased.directed.petrinet.configurable
Class ConfigurableParameter<F>

java.lang.Object
  extended by org.processmining.models.graphbased.directed.petrinet.configurable.ConfigurableParameter<F>
Type Parameters:
F -
Direct Known Subclasses:
ConfigurableParameterGraphElement, ConfigurableParameterInteger

public abstract class ConfigurableParameter<F>
extends java.lang.Object

A configurable parameter has a name (getId()), a domain that is either given as discrete enumeration or as a range of values in an interval, and a default value.

Author:
dfahland

Constructor Summary
ConfigurableParameter(java.lang.String id, F[] values, F defaultValue)
          Create new configurable parameter ranging over a discrete domain of values, wit given default value.
ConfigurableParameter(java.lang.String id, F min, F max, F defaultValue)
          Create a new configurable parameter ranging over values from the given interval with a given default value.
 
Method Summary
 F[] getDiscreteDomain()
           
 java.lang.String getId()
           
 F getIntervalMax()
           
 F getIntervalMin()
           
 F getValue()
           
 boolean isIntervalDomain()
           
protected abstract  boolean isValidIntervalValue(F value)
           
 boolean isValidValue(F value)
           
 void setDiscreteDomain(F[] values)
          Set a list of values the feature can take.
 void setId(java.lang.String id)
           
 void setIntervalDomain(F min, F max)
          Set a range of values the feature can take.
 void setValue(java.lang.Object value)
          Set chosen value of the feature.
 void updateParameter(ConfigurableParameter<F> update)
          Update domain and value of this parameter by copying values from the given parameter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConfigurableParameter

public ConfigurableParameter(java.lang.String id,
                             F[] values,
                             F defaultValue)
                      throws InvalidConfigurationException
Create new configurable parameter ranging over a discrete domain of values, wit given default value.

Parameters:
element -
values -
defaultValue -
Throws:
InvalidConfigurationException

ConfigurableParameter

public ConfigurableParameter(java.lang.String id,
                             F min,
                             F max,
                             F defaultValue)
                      throws InvalidConfigurationException
Create a new configurable parameter ranging over values from the given interval with a given default value.

Parameters:
element -
min -
max -
defaultValue -
Throws:
InvalidConfigurationException
Method Detail

setIntervalDomain

public void setIntervalDomain(F min,
                              F max)
Set a range of values the feature can take.

Parameters:
min -
max -

getIntervalMin

public F getIntervalMin()
Returns:
minimum value if domain is an interval (isIntervalDomain())

getIntervalMax

public F getIntervalMax()
Returns:
maximum value if domain is an interval (isIntervalDomain())

setDiscreteDomain

public void setDiscreteDomain(F[] values)
Set a list of values the feature can take.

Parameters:
values -

getDiscreteDomain

public F[] getDiscreteDomain()
Returns:
list of values, if domain is discrete (isIntervalDomain())

isIntervalDomain

public boolean isIntervalDomain()
Returns:
true iff domain of the feature is an interval domain (this is the case when setIntervalDomain(Object, Object) is used to set the domain), and false iff domain of the feature is a discrete domain (this is the case when setDiscreteDomain(Object[]) is used to set the domain)

setValue

public void setValue(java.lang.Object value)
              throws InvalidConfigurationException
Set chosen value of the feature.

Parameters:
value -
Throws:
InvalidConfigurationException - if value is invalid for this feature

getValue

public F getValue()
Returns:
currently chosen value of the feature

isValidValue

public boolean isValidValue(F value)
Parameters:
value -
Returns:
true iff the given value is in the domain of the feature

isValidIntervalValue

protected abstract boolean isValidIntervalValue(F value)

getId

public java.lang.String getId()

setId

public void setId(java.lang.String id)

updateParameter

public void updateParameter(ConfigurableParameter<F> update)
                     throws InvalidConfigurationException
Update domain and value of this parameter by copying values from the given parameter.

Parameters:
update -
Throws:
InvalidConfigurationException