Package: ConjectureValue

ConjectureValue

nameinstructionbranchcomplexitylinemethod
ConjectureValue(ConjectureDefinition, long, long, int)
M: 25 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 9 C: 0
0%
M: 1 C: 0
0%
getEndTime()
M: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
isEnded()
M: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
isValidated()
M: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
printValidation()
M: 58 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 8 C: 0
0%
M: 1 C: 0
0%
setEnd(long, long, int)
M: 23 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 7 C: 0
0%
M: 1 C: 0
0%

Coverage

1: /***************************************************************************
2: *
3: *        Copyright (c) 2009 IHA
4: *
5: *        Author: Kenneth Lausdahl and Augusto Ribeiro
6: *
7: *        This file is part of VDMJ.
8: *
9: *        VDMJ is free software: you can redistribute it and/or modify
10: *        it under the terms of the GNU General Public License as published by
11: *        the Free Software Foundation, either version 3 of the License, or
12: *        (at your option) any later version.
13: *
14: *        VDMJ is distributed in the hope that it will be useful,
15: *        but WITHOUT ANY WARRANTY; without even the implied warranty of
16: *        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17: *        GNU General Public License for more details.
18: *
19: *        You should have received a copy of the GNU General Public License
20: *        along with VDMJ. If not, see <http://www.gnu.org/licenses/>.
21: *
22: **************************************************************************/
23:
24: package org.overture.interpreter.runtime.validation;
25:
26: import org.overture.interpreter.messages.Console;
27:
28: public class ConjectureValue
29: {
30:
31:         private ConjectureDefinition def;
32:         public long triggerTime;
33:         public boolean validated;
34:
35:         // Responsible threads/objects
36:         public long triggerThreadId;
37:         public int triggerObjectId;
38:
39:         public long endThreadId;
40:         public int endObjectId;
41:
42:         public long endTime;
43:         private boolean isEnded = false;
44:
45:         public ConjectureValue(ConjectureDefinition def, long triggerTime,
46:                         long triggerThreadId, int triggerObjectId)
47:         {
48:                 this.def = def;
49:                 this.triggerTime = triggerTime;
50:                 this.validated = def.startupValue;
51:                 this.triggerThreadId = triggerThreadId;
52:                 this.triggerObjectId = triggerObjectId;
53:                 this.endTime = 0;
54:         }
55:
56:         public void setEnd(long endTime, long threadId, int objectReference)
57:         {
58:                 this.isEnded = true;
59:                 this.endTime = endTime;
60:                 this.endThreadId = threadId;
61:                 this.endObjectId = objectReference;
62:                 this.validated = this.def.validate(triggerTime, endTime);
63:                 printValidation();
64:         }
65:
66:         private void printValidation()
67:         {
68:                 Console.out.println("----------------------------------------------------------------------------------");
69:                 Console.out.print("Conjecture: ");
70:                 Console.out.println(def.toString());
71:                 Console.out.println("Validated: " + this.validated);
72:                 Console.out.println("Trigger - time: " + triggerTime + " thread: "
73:                                 + triggerThreadId);
74:                 Console.out.println("Ending - time: " + endTime + " thread: "
75:                                 + endThreadId);
76:                 Console.out.println("----------------------------------------------------------------------------------");
77:
78:         }
79:
80:         public boolean isValidated()
81:         {
82:                 return this.validated;
83:         }
84:
85:         public boolean isEnded()
86:         {
87:                 return this.isEnded;
88:         }
89:
90:         public long getEndTime()
91:         {
92:                 return endTime;
93:         }
94:
95: }