de.cau.cs.kieler.core.kivi
Class CombinationParameter<T>

java.lang.Object
  extended by de.cau.cs.kieler.core.kivi.CombinationParameter<T>
Type Parameters:
T - the type of parameter
All Implemented Interfaces:
IProperty<T>

public class CombinationParameter<T>
extends Object
implements IProperty<T>

Describes a parameter of a combination.

Rating red

Constructor Summary
CombinationParameter(String k, IPreferenceStore store, String n, String d, Class<T> clazz)
          Create a new combination parameter without a default value.
CombinationParameter(String k, IPreferenceStore store, String n, String d, T def)
          Create a new combination parameter with default value.
 
Method Summary
 T getDefault()
          Get the default value of this parameter.
 String getDescription()
          Get a readable description for this parameter.
 String getId()
          Get the preference key.
 Comparable<T> getLowerBound()
          Returns the lower bound of this property.
 String getName()
          Get a readable name for this parameter.
static CombinationParameter<?>[] getParameters(Class<? extends ICombination> combination)
          Retrieve the combination parameters from a combination class.
 IPreferenceStore getPreferenceStore()
          Get the preference store used to save this key-value pair.
 Class<T> getType()
          Get the type of this parameter.
 Comparable<T> getUpperBound()
          Returns the upper bound of this property.
 void initialize()
          Initialize the default value of the combination parameter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CombinationParameter

public CombinationParameter(String k,
                            IPreferenceStore store,
                            String n,
                            String d,
                            T def)
Create a new combination parameter with default value.

Parameters:
k - the preference key
store - the preference store
n - the readable name
d - the readable description
def - the default value

CombinationParameter

public CombinationParameter(String k,
                            IPreferenceStore store,
                            String n,
                            String d,
                            Class<T> clazz)
Create a new combination parameter without a default value.

Parameters:
k - the preference key
store - the preference store
n - the readable name
d - the readable description
clazz - The parameter class
Method Detail

getId

public String getId()
Get the preference key.

Specified by:
getId in interface IProperty<T>
Returns:
the key

getPreferenceStore

public IPreferenceStore getPreferenceStore()
Get the preference store used to save this key-value pair.

Returns:
the preference store

getName

public String getName()
Get a readable name for this parameter.

Returns:
the name

getDescription

public String getDescription()
Get a readable description for this parameter.

Returns:
the description

getType

public Class<T> getType()
Get the type of this parameter.

Returns:
the type

getDefault

public T getDefault()
Get the default value of this parameter.

Specified by:
getDefault in interface IProperty<T>
Returns:
the default value

initialize

public void initialize()
Initialize the default value of the combination parameter.


getLowerBound

public Comparable<T> getLowerBound()
Returns the lower bound of this property. If there is no lower bound, a comparable is returned that is smaller than everything else.

Specified by:
getLowerBound in interface IProperty<T>
Returns:
the lower bound

getUpperBound

public Comparable<T> getUpperBound()
Returns the upper bound of this property. If there is no upper bound, a comparable is returned that is greater than everything else.

Specified by:
getUpperBound in interface IProperty<T>
Returns:
the upper bound

getParameters

public static CombinationParameter<?>[] getParameters(Class<? extends ICombination> combination)
Retrieve the combination parameters from a combination class.

Parameters:
combination - the combination class to look in
Returns:
its combination parameters, or an empty array if there are none