Coverage details for net.sourceforge.demetrix.util.ObjectComparator

LineHitsSource
1 /*
2  
3  * Created on 08.01.2004
4  
5  */
6  
7 package net.sourceforge.demetrix.util;
8  
9  
10  
11 /**
12  
13  * @author Dimitri Pissarenko
14  
15  *
16  
17  */
18  
19  
20  
21 import java.util.Collection;
22  
23  
24  
250public class ObjectComparator {
26  
27     public static boolean areEqual(Object obj1, Object obj2) {
28  
291088        boolean areEqual = false;
30  
311088        if ((obj1 == null) && (obj2 == null)) {
32  
3313            areEqual = true;
34  
351075        } else if ((obj1 == null) && (obj2 != null)) {
36  
370            areEqual = false;
38  
391075        } else if ((obj1 != null) && (obj2 == null)) {
40  
410            areEqual = false;
42  
431075        } else if (obj1.equals(obj2)) {
44  
45695            areEqual = true;
46  
47         }
48  
491088        return areEqual;
50  
51     }
52  
53     public static boolean areEqualIrrespectiveOfOrder(
54  
55         Collection obj1,
56  
57         Collection obj2) {
58  
59394        boolean areEqual = false;
60  
61394        if ((obj1 == null) && (obj2 == null)) {
62  
630            areEqual = true;
64  
65394        } else if ((obj1 == null) && (obj2 != null)) {
66  
670            areEqual = false;
68  
69394        } else if ((obj1 != null) && (obj2 == null)) {
70  
710            areEqual = false;
72  
73394        } else if (obj1.containsAll(obj2) && obj2.containsAll(obj1)) {
74  
7568            areEqual = true;
76  
77         }
78  
79394        return areEqual;
80  
81     }
82  
83  
84  
85 }
86  

this report was generated by version 1.0.5 of jcoverage.
visit www.jcoverage.com for updates.

copyright © 2003, jcoverage ltd. all rights reserved.
Java is a trademark of Sun Microsystems, Inc. in the United States and other countries.