org.graphstream.algorithm
Annotation Type DefineParameter


@Documented
@Target(value=FIELD)
@Retention(value=RUNTIME)
public @interface DefineParameter

Annotation allowing to define parameters in algorithm.

Author:
Guilhelm Savin

Required Element Summary
 String name
          Name of the parameter.
 
Optional Element Summary
 String afterSet
          Defines name of a function to call after setting the value of the parameter.
 String beforeSet
          Defines name of a function to call before setting the value of the parameter.
 String description
          Description of the parameter.
 double max
          Maximum value used for number parameter.
 double min
          Minimum value used for number parameter.
 boolean optional
          Defines if the parameter is optional.
 int priority
          Defines the priority of the parameter.
 String setter
          Defines name of a function to call to set the value of the parameter.
 String[] strings
          For String parameters, this allows to define a restricted set of values for the parameter.
 Class<?> type
          Class of the parameter.
 

Element Detail

name

public abstract String name
Name of the parameter.

description

public abstract String description
Description of the parameter.

Default:
""

min

public abstract double min
Minimum value used for number parameter.

Default:
0d/0d

max

public abstract double max
Maximum value used for number parameter.

Default:
0d/0d

type

public abstract Class<?> type
Class of the parameter.

Default:
java.lang.Object.class

strings

public abstract String[] strings
For String parameters, this allows to define a restricted set of values for the parameter.

Default:
{}

beforeSet

public abstract String beforeSet
Defines name of a function to call before setting the value of the parameter. If argument count of the function is zero, then the function will not receive argument. Else, if one argument is needed, the function will receive the value of parameter, if two arguments are needed, the function will receive the name of the parameter as a String and the value.

Default:
""

afterSet

public abstract String afterSet
Defines name of a function to call after setting the value of the parameter. If argument count of the function is zero, then the function will not receive argument. Else, if one argument is needed, the function will receive the value of parameter, if two arguments are needed, the function will receive the name of the parameter as a String and the value.

Default:
""

setter

public abstract String setter
Defines name of a function to call to set the value of the parameter. If one argument is needed, the function will receive the value of parameter, if two arguments are needed, the function will receive the name of the parameter as a String and the value.

Default:
""

priority

public abstract int priority
Defines the priority of the parameter. This is not yet implemented.

Default:
0

optional

public abstract boolean optional
Defines if the parameter is optional. This is used to throw a MissingParameterException during an initialization step to be sure that core parameters are present.

Default:
true


Copyright © 2012. All Rights Reserved.