next up previous contents
Next: 3.2.2 Local Parameters Up: 3.2 MDL Classes Previous: 3.2 MDL Classes


3.2.1 Interface Parameters

New interface parameters can be defined by listing them in the Interface block statement of an MDL model definition. Every MDL model can contain one Interface block statement which is initiated by using the Interface keyword followed by a list of parameter definitions enclosed in braces:

Interface {
   protection Parameter<type> name = initial_value;
}

The definition of a parameter itself consists of a sequence of the following elements:

Interface parameters can be referred to within all methods of the MDL class by using the ``:'' qualifier.

Various definitions of interface parameters are demonstrated in Example 3.10.

\includegraphics[width=0.6cm]{figures/exaLeft.eps}

Interface {
             Parameter<double>     x;
   private   Parameter<int>        y     = 1 + 2*3;
   protected Parameter<MdlString>  name  = "Hugo";
}

Example 3.10: Interface definition


next up previous contents
Next: 3.2.2 Local Parameters Up: 3.2 MDL Classes Previous: 3.2 MDL Classes
Robert Mlekus
1999-11-14