Package: LexNameTokenWrapper

LexNameTokenWrapper

nameinstructionbranchcomplexitylinemethod
LexNameTokenWrapper(ILexNameToken)
M: 0 C: 6
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 3
100%
M: 0 C: 1
100%
equals(Object)
M: 4 C: 10
71%
M: 1 C: 1
50%
M: 1 C: 1
50%
M: 1 C: 2
67%
M: 0 C: 1
100%
hashCode()
M: 0 C: 4
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
toString()
M: 4 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: * The VDM Type Checker
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.typechecker.util;
23:
24: import java.io.Serializable;
25:
26: import org.overture.ast.intf.lex.ILexNameToken;
27:
28: class LexNameTokenWrapper implements Serializable
29: {
30:
31:         /**
32:                  *
33:                  */
34:         private static final long serialVersionUID = -5420007432629328108L;
35:         public ILexNameToken token;
36:
37:         public LexNameTokenWrapper(ILexNameToken token)
38:         {
39:                 this.token = token;
40:         }
41:
42:         @Override
43:         public boolean equals(Object obj)
44:         {
45:•                if (obj instanceof LexNameTokenWrapper)
46:                 {
47:                         return HackLexNameToken.isEqual(this.token, ((LexNameTokenWrapper) obj).token);
48:                 }
49:
50:                 return super.equals(obj);
51:         }
52:
53:         @Override
54:         public int hashCode()
55:         {
56:                 return this.token.hashCode();
57:         }
58:
59:         @Override
60:         public String toString()
61:         {
62:                 return token.toString();
63:         }
64: }