|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
EqualsUtility | Line # 26 | 20 | 13 | 97.6% |
0.9756098
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||
(9) | |||
Result | |||
0.24390244
|
org.qedeq.base.utility.EqualsUtilityTest.testEqualsIntArray
![]() |
1 PASS | |
0.24390244
|
org.qedeq.base.utility.EqualsUtilityTest.testEqualsObject
![]() |
1 PASS | |
0.24390244
|
org.qedeq.base.utility.EqualsUtilityTest.testEqualsObjectArray
![]() |
1 PASS | |
0.24390244
|
org.qedeq.base.utility.EqualsUtilityTest.testEqualsByteArray
![]() |
1 PASS | |
0.09756097
|
org.qedeq.base.io.IoUtilityTest.testLoadAndSaveFileBinary
![]() |
1 PASS | |
0.09756097
|
org.qedeq.base.io.PathTest.testCreateRelative
![]() |
1 PASS | |
0.09756097
|
org.qedeq.base.io.IoUtilityTest.testCreateRelativePath
![]() |
1 PASS | |
0.09756097
|
org.qedeq.base.io.PathTest.testEquals1
![]() |
1 PASS | |
0.09756097
|
org.qedeq.base.io.IoUtilityTest.testCreateRelativePath2
![]() |
1 PASS | |
1 | /* This file is part of the project "Hilbert II" - http://www.qedeq.org | |
2 | * | |
3 | * Copyright 2000-2014, Michael Meyling <mime@qedeq.org>. | |
4 | * | |
5 | * "Hilbert II" is free software; you can redistribute | |
6 | * it and/or modify it under the terms of the GNU General Public | |
7 | * License as published by the Free Software Foundation; either | |
8 | * version 2 of the License, or (at your option) any later version. | |
9 | * | |
10 | * This program is distributed in the hope that it will be useful, | |
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
13 | * GNU General Public License for more details. | |
14 | */ | |
15 | ||
16 | package org.qedeq.base.utility; | |
17 | ||
18 | import java.util.Arrays; | |
19 | ||
20 | ||
21 | /** | |
22 | * A collection of useful static methods for equality. | |
23 | * | |
24 | * @author Michael Meyling | |
25 | */ | |
26 | public final class EqualsUtility { | |
27 | ||
28 | /** | |
29 | * Constructor, should never be called. | |
30 | */ | |
31 | 0 |
![]() |
32 | // don't call me | |
33 | } | |
34 | ||
35 | /** | |
36 | * Compare two objects, each of them could be <code>null</code>. | |
37 | * | |
38 | * @param a First parameter. | |
39 | * @param b Second parameter. | |
40 | * @return Are <code>a</code> and <code>b</code> equal? | |
41 | */ | |
42 | 48 |
![]() |
43 | 48 | if (a == null) { |
44 | 3 | if (b == null) { |
45 | 1 | return true; |
46 | } | |
47 | 2 | return false; |
48 | } | |
49 | 45 | return a.equals(b); |
50 | } | |
51 | ||
52 | /** | |
53 | * Compare two objects, each of them could be <code>null</code>. | |
54 | * | |
55 | * @param a First parameter. | |
56 | * @param b Second parameter. | |
57 | * @return Are <code>a</code> and <code>b</code> equal? | |
58 | */ | |
59 | 22 |
![]() |
60 | 22 | if (a == null) { |
61 | 3 | if (b == null) { |
62 | 1 | return true; |
63 | } | |
64 | 2 | return false; |
65 | } | |
66 | 19 | return Arrays.equals(a, b); |
67 | } | |
68 | ||
69 | /** | |
70 | * Compare two objects, each of them could be <code>null</code>. | |
71 | * | |
72 | * @param a First parameter. | |
73 | * @param b Second parameter. | |
74 | * @return Are <code>a</code> and <code>b</code> equal? | |
75 | */ | |
76 | 14 |
![]() |
77 | 14 | if (a == null) { |
78 | 3 | if (b == null) { |
79 | 1 | return true; |
80 | } | |
81 | 2 | return false; |
82 | } | |
83 | 11 | return Arrays.equals(a, b); |
84 | } | |
85 | ||
86 | /** | |
87 | * Compare two objects, each of them could be <code>null</code>. | |
88 | * | |
89 | * @param a First parameter. | |
90 | * @param b Second parameter. | |
91 | * @return Are <code>a</code> and <code>b</code> equal? | |
92 | */ | |
93 | 13 |
![]() |
94 | 13 | if (a == null) { |
95 | 3 | if (b == null) { |
96 | 1 | return true; |
97 | } | |
98 | 2 | return false; |
99 | } | |
100 | 10 | return Arrays.equals(a, b); |
101 | } | |
102 | ||
103 | } |
|