KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > openide > filesystems > multifs > MFSDataDescriptor


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.openide.filesystems.multifs;
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 MFSDataDescriptor extends DataDescriptor {
30
31     private int foCount;
32     private int fsCount;
33
34     private FileWrapper[] wrappers;
35
36     /** New MFSDataDescriptor */
37     public MFSDataDescriptor(int foCount, int fsCount) {
38         this.foCount = foCount;
39         this.fsCount = fsCount;
40     }
41
42     /** Setter for wrappers */
43     void setFileWrappers(FileWrapper[] wrappers) {
44         this.wrappers = wrappers;
45     }
46     
47     /** Getter for wrappers */
48     public FileWrapper[] getFileWrappers() {
49         return wrappers;
50     }
51     
52     /** Getter for foCount */
53     public int getFoCount() {
54         return foCount;
55     }
56     
57     /** Getter for xmlfsCount */
58     public int getFsCount() {
59         return fsCount;
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 MFSDataDescriptor) {
74             MFSDataDescriptor dd = (MFSDataDescriptor) obj;
75             return getClassName().equals(dd.getClassName()) && foCount == dd.foCount && fsCount == dd.fsCount;
76         }
77         
78         return false;
79     }
80 }
81
Popular Tags