KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > cocoon > components > repository > helpers > PropertyName


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

16 package org.apache.cocoon.components.repository.helpers;
17
18 /**
19  * A PropertyName object intentifies a specific property.
20  */

21 public class PropertyName {
22
23     private String JavaDoc name;
24     private String JavaDoc namespace;
25     
26     /**
27      * creates a PropertyName
28      *
29      * @param name the name of the property.
30      * @param namespace the namespace of the property.
31      */

32     public PropertyName(String JavaDoc name, String JavaDoc namespace) {
33         this.name = name;
34         this.namespace = namespace;
35     }
36
37     /**
38      * get the name of the property
39      *
40      * @return the name of the property.
41      */

42     public String JavaDoc getName() {
43         return this.name;
44     }
45
46     /**
47      * get the namespace of the property
48      *
49      * @return the namespace of the property.
50      */

51     public String JavaDoc getNamespace() {
52         return this.namespace;
53     }
54
55     /* (non-Javadoc)
56      * @see java.lang.Object#hashCode()
57      */

58     public int hashCode() {
59         return (this.namespace+":"+this.name).hashCode();
60     }
61
62     /* (non-Javadoc)
63      * @see java.lang.Object#equals(java.lang.Object)
64      */

65     public boolean equals(Object JavaDoc obj) {
66         return (obj != null && (obj instanceof PropertyName)
67                 && this.name.equals(((PropertyName)obj).getName())
68                 && this.namespace.equals(((PropertyName)obj).getNamespace()));
69     }
70
71 }
72
Popular Tags