Headline

Model fields are used in Language:JML to represent values

Description

In Language:JML model fields are used to "assign" an existing value to it or to add some variables to a model of the type JMLDatagroup to make the assignable function more easily. When the model field gets an assigned vaue it is updating it constantly in runtime. It gets initialized in the following way:

//@ <visibility> model <Type of the field> <name>;

Illustration

Here we will give a short introduction in the use of model fields. For an advanced use take a look at the Contribution:JML Specs.

  • Using a model field to represent a value, by using the "represent"-clause. Note that it is easy to change the visibility of an private variable to public by using a model field:
//Initialization of salary as an private variable
private int salary = 200;

//Initialization of the model field "mainSalary"
//@ public model Int mainSalary;
//Value sync of mainSalary to salary
//@ private represents mainSalary = salary
  • Using a model field as an sort of a Datagroup. Variables are able to be "added" to an Datagroup by using the special "in" keyword directly after the initialisation of the variable. So this Datagroup can easily be used in a assignable-clause instead of all of the variables separately
//Initialization of the specail "JMLDataGroup"
//@ public model JMLDataGroup allEmployees;

//Initialization of the variables   //Adding an element to the Datagroup
public employee mentor;              //@ in allEmployees
public List<Employee> mentees;      //@ in allEmployees

There are no revisions for this page.

User contributions

    This user never has never made submissions.

    User edits

    Syntax for editing wiki

    For you are available next options:

    will make text bold.

    will make text italic.

    will make text underlined.

    will make text striked.

    will allow you to paste code headline into the page.

    will allow you to link into the page.

    will allow you to paste code with syntax highlight into the page. You will need to define used programming language.

    will allow you to paste image into the page.

    is list with bullets.

    is list with numbers.

    will allow your to insert slideshare presentation into the page. You need to copy link to presentation and insert it as parameter in this tag.

    will allow your to insert youtube video into the page. You need to copy link to youtube page with video and insert it as parameter in this tag.

    will allow your to insert code snippets from @worker.

    Syntax for editing wiki

    For you are available next options:

    will make text bold.

    will make text italic.

    will make text underlined.

    will make text striked.

    will allow you to paste code headline into the page.

    will allow you to link into the page.

    will allow you to paste code with syntax highlight into the page. You will need to define used programming language.

    will allow you to paste image into the page.

    is list with bullets.

    is list with numbers.

    will allow your to insert slideshare presentation into the page. You need to copy link to presentation and insert it as parameter in this tag.

    will allow your to insert youtube video into the page. You need to copy link to youtube page with video and insert it as parameter in this tag.

    will allow your to insert code snippets from @worker.