KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > core > MUCDataDescriptor


1 /*
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8  *
9  * When distributing Covered Code, include this CDDL Header Notice in each file
10  * and include the License file at http://www.netbeans.org/cddl.txt.
11  * If applicable, add the following below the CDDL Header, with the fields
12  * enclosed by brackets [] replaced by your own identifying information:
13  * "Portions Copyrighted [year] [name of copyright owner]"
14  *
15  * The Original Software is NetBeans. The Initial Developer of the Original
16  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19 package org.netbeans.core;
20
21 import java.io.File JavaDoc;
22
23 import org.netbeans.performance.DataDescriptor;
24 import org.openide.filesystems.multifs.MultiXMLFSTest.FileWrapper;
25
26 /**
27  * Describes data
28  */

29 final class MUCDataDescriptor extends DataDescriptor {
30
31     private int classCount;
32     private int fsCount;
33
34     private DataDescriptor dd;
35
36     /** New MFSDataDescriptor */
37     public MUCDataDescriptor(int classCount, int fsCount) {
38         this.classCount = classCount;
39         this.fsCount = fsCount;
40     }
41
42     /** Getter for classCount */
43     public int getClassCount() {
44         return classCount;
45     }
46     
47     /** Getter for xmlfsCount */
48     public int getFsCount() {
49         return fsCount;
50     }
51     
52     /** Getter for dd */
53     public DataDescriptor getDD() {
54         return dd;
55     }
56     
57     /** Setter for dd */
58     public void setDD(DataDescriptor dd) {
59         this.dd = dd;
60     }
61     
62     /** @return hashCode */
63     public int hashCode() {
64         return getClassName().hashCode();
65     }
66     
67     /** @return boolean iff obj equals this */
68     public boolean equals(Object JavaDoc obj) {
69         if (obj == this) {
70             return true;
71         }
72         
73         if (obj instanceof MUCDataDescriptor) {
74             MUCDataDescriptor dd = (MUCDataDescriptor) obj;
75             
76             boolean flag = this.dd == dd.dd || this.dd == null || this.dd.equals(dd.dd);
77             
78             return flag && getClassName().equals(dd.getClassName()) && classCount == dd.classCount && fsCount == dd.fsCount;
79         }
80         
81         return false;
82     }
83 }
84
Popular Tags