KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > directory > ldapstudio > browser > core > internal > model > ChildrenInfo


1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one
3  * or more contributor license agreements. See the NOTICE file
4  * distributed with this work for additional information
5  * regarding copyright ownership. The ASF licenses this file
6  * to you under the Apache License, Version 2.0 (the
7  * "License"); you may not use this file except in compliance
8  * with the License. You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing,
13  * software distributed under the License is distributed on an
14  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15  * KIND, either express or implied. See the License for the
16  * specific language governing permissions and limitations
17  * under the License.
18  *
19  */

20
21 package org.apache.directory.ldapstudio.browser.core.internal.model;
22
23
24 import java.io.Serializable JavaDoc;
25 import java.util.Set JavaDoc;
26
27 import org.apache.directory.ldapstudio.browser.core.model.DN;
28 import org.apache.directory.ldapstudio.browser.core.model.IConnection;
29
30
31 public class ChildrenInfo implements Serializable JavaDoc
32 {
33
34     private static final long serialVersionUID = -4642987611142312896L;
35
36     public static int COUNTER = 0;
37
38     protected volatile boolean childrenInitialzed = false;
39
40     protected volatile Set JavaDoc childrenSet = null;
41
42     protected volatile boolean hasMoreChildren = false;
43
44
45     public ChildrenInfo()
46     {
47         COUNTER++;
48     }
49
50     class AliasOrReferral implements Serializable JavaDoc
51     {
52
53         private static final long serialVersionUID = -8339682035388780022L;
54
55         protected IConnection connection;
56
57         protected DN dn;
58
59
60         protected AliasOrReferral()
61         {
62         }
63
64
65         public AliasOrReferral( IConnection connection, DN dn )
66         {
67             this.connection = connection;
68             this.dn = dn;
69         }
70
71
72         public boolean equals( Object JavaDoc o ) throws ClassCastException JavaDoc
73         {
74             if ( o instanceof AliasOrReferral )
75             {
76                 return this.toString().equals( ( ( AliasOrReferral ) o ).toString() );
77             }
78             return false;
79         }
80
81
82         public int hashCode()
83         {
84             return this.toString().hashCode();
85         }
86
87
88         public String JavaDoc toString()
89         {
90             return connection.hashCode() + "_" + dn.toString(); //$NON-NLS-1$
91
}
92
93     }
94
95 }
96
Popular Tags