KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > directory > ldapstudio > browser > core > model > schema > SchemaPart


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.model.schema;
22
23
24 import java.io.Serializable JavaDoc;
25
26 import org.apache.directory.ldapstudio.browser.core.model.ldif.lines.LdifAttrValLine;
27
28
29 public abstract class SchemaPart implements Comparable JavaDoc, Serializable JavaDoc
30 {
31
32     protected LdifAttrValLine line;
33
34     protected Schema schema;
35
36     protected String JavaDoc numericOID;
37
38     protected String JavaDoc desc;
39
40
41     protected SchemaPart()
42     {
43         this.schema = null;
44         this.numericOID = null;
45         this.desc = null;
46     }
47
48
49     /**
50      *
51      * @return the schema
52      */

53     public Schema getSchema()
54     {
55         return schema;
56     }
57
58
59     public void setSchema( Schema schema )
60     {
61         this.schema = schema;
62     }
63
64
65     /**
66      *
67      * @return the numeric OID
68      */

69     public String JavaDoc getNumericOID()
70     {
71         return numericOID;
72     }
73
74
75     public void setNumericOID( String JavaDoc numericOID )
76     {
77         this.numericOID = numericOID;
78     }
79
80
81     /**
82      *
83      * @return true if this syntax description is part of the default schema
84      */

85     public boolean isDefault()
86     {
87         return this.schema.isDefault();
88     }
89
90
91     /**
92      *
93      * @return the desc, may be null
94      */

95     public String JavaDoc getDesc()
96     {
97         return desc;
98     }
99
100
101     public void setDesc( String JavaDoc desc )
102     {
103         this.desc = desc;
104     }
105
106
107     public LdifAttrValLine getLine()
108     {
109         return line;
110     }
111
112
113     public void setLine( LdifAttrValLine line )
114     {
115         this.line = line;
116     }
117
118     
119     public boolean equals( Object JavaDoc obj )
120     {
121         if ( obj instanceof SchemaPart )
122         {
123             return this.getClass() == obj.getClass() && this.toString().equals( obj.toString() );
124         }
125         else
126         {
127             return false;
128         }
129     }
130     
131     
132     public int hashCode()
133     {
134         return toString().hashCode();
135     }
136     
137 }
138
Popular Tags