Package: Maplet

Maplet

nameinstructionbranchcomplexitylinemethod
Maplet(Object, Object)
M: 0 C: 9
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 4
100%
M: 0 C: 1
100%
equals(Object)
M: 53 C: 0
0%
M: 22 C: 0
0%
M: 12 C: 0
0%
M: 14 C: 0
0%
M: 1 C: 0
0%
getLeft()
M: 0 C: 3
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
getRight()
M: 0 C: 3
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
hashCode()
M: 22 C: 0
0%
M: 4 C: 0
0%
M: 3 C: 0
0%
M: 6 C: 0
0%
M: 1 C: 0
0%
toString()
M: 19 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%

Coverage

1: /*
2: * #%~
3: * VDM Code Generator Runtime
4: * %%
5: * Copyright (C) 2008 - 2014 Overture
6: * %%
7: * This program is free software: you can redistribute it and/or modify
8: * it under the terms of the GNU General Public License as
9: * published by the Free Software Foundation, either version 3 of the
10: * License, or (at your option) any later version.
11: *
12: * This program is distributed in the hope that it will be useful,
13: * but WITHOUT ANY WARRANTY; without even the implied warranty of
14: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15: * GNU General Public License for more details.
16: *
17: * You should have received a copy of the GNU General Public
18: * License along with this program. If not, see
19: * <http://www.gnu.org/licenses/gpl-3.0.html>.
20: * #~%
21: */
22: package org.overture.codegen.runtime;
23:
24: public class Maplet
25: {
26:         private Object left;
27:         private Object right;
28:
29:         public Maplet(Object left, Object right)
30:         {
31:                 super();
32:                 this.left = left;
33:                 this.right = right;
34:         }
35:
36:         public Object getLeft()
37:         {
38:                 return left;
39:         }
40:
41:         public Object getRight()
42:         {
43:                 return right;
44:         }
45:
46:         @Override
47:         public int hashCode()
48:         {
49:                 int hash = 0;
50:
51:•                if (left != null)
52:                 {
53:                         hash += left.hashCode();
54:                 }
55:
56:•                if (right != null)
57:                 {
58:                         hash += right.hashCode();
59:                 }
60:
61:                 return hash;
62:         }
63:
64:         @Override
65:         public boolean equals(Object obj)
66:         {
67:•                if (obj == null)
68:                 {
69:                         return false;
70:                 }
71:
72:•                if (this == obj)
73:                 {
74:                         return true;
75:                 }
76:
77:•                if (!(obj instanceof Maplet))
78:                 {
79:                         return false;
80:                 }
81:
82:                 final Maplet other = (Maplet) obj;
83:
84:•                if (this.left == null && other.left != null
85:•                                || this.left != null && !this.left.equals(other.left))
86:                 {
87:                         return false;
88:                 }
89:
90:•                if (this.right == null && other.right != null
91:•                                || this.right != null && !this.right.equals(other.right))
92:                 {
93:                         return false;
94:                 }
95:
96:                 return true;
97:         }
98:
99:         @Override
100:         public String toString()
101:         {
102:                 return "{" + Utils.toString(left) + " |-> " + Utils.toString(right)
103:                                 + "}";
104:         }
105: }