File tree Expand file tree Collapse file tree 1 file changed +22
-10
lines changed Expand file tree Collapse file tree 1 file changed +22
-10
lines changed Original file line number Diff line number Diff line change 10
10
11
11
package example ;
12
12
13
- import cartago .*;
13
+ import cartago .Artifact ;
14
+ import cartago .OPERATION ;
15
+ import cartago .ObsProperty ;
14
16
17
+ /**
18
+ * Example class for Cartago env.
19
+ */
15
20
public class Counter extends Artifact {
16
- void init (int initialValue ) {
17
- defineObsProperty ("count" , initialValue );
18
- }
21
+ /**
22
+ * Init counter.
23
+ * @param initialValue
24
+ */
25
+ void init (final int initialValue ) {
26
+ defineObsProperty ("count" , initialValue );
27
+ }
19
28
20
- @ OPERATION
21
- void inc () {
22
- ObsProperty prop = getObsProperty ("count" );
23
- prop .updateValue (prop .intValue ()+1 );
24
- signal ("tick" );
25
- }
29
+ /**
30
+ * Inc operation.
31
+ */
32
+ @ OPERATION
33
+ void inc () {
34
+ final ObsProperty prop = getObsProperty ("count" );
35
+ prop .updateValue (prop .intValue () + 1 );
36
+ signal ("tick" );
37
+ }
26
38
}
27
39
You can’t perform that action at this time.
0 commit comments