KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > opencms > template > cache > CmsUriDescriptor


1 /*
2 * File : $Source: /usr/local/cvs/opencms/src-modules/com/opencms/template/cache/CmsUriDescriptor.java,v $
3 * Date : $Date: 2005/05/17 13:47:27 $
4 * Version: $Revision: 1.1 $
5 *
6 * This library is part of OpenCms -
7 * the Open Source Content Mananagement System
8 *
9 * Copyright (C) 2001 The OpenCms Group
10 *
11 * This library is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU Lesser General Public
13 * License as published by the Free Software Foundation; either
14 * version 2.1 of the License, or (at your option) any later version.
15 *
16 * This library is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 * Lesser General Public License for more details.
20 *
21 * For further information about OpenCms, please see the
22 * OpenCms Website: http://www.opencms.org
23 *
24 * You should have received a copy of the GNU Lesser General Public
25 * License along with this library; if not, write to the Free Software
26 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
27 */

28
29 package com.opencms.template.cache;
30
31
32 /**
33  * This descriptor is used to locate CmsUri-Object with the CmsUriLocator. It
34  * is the key for a CmsUri.
35  *
36  * @author Andreas Schouten
37  *
38  * @deprecated Will not be supported past the OpenCms 6 release.
39  */

40 public class CmsUriDescriptor {
41
42     /**
43      * The uri string
44      */

45     private String JavaDoc m_uri;
46
47     /**
48      * Creates a new UriDescriptor
49      * @param uri - the uri
50      */

51     public CmsUriDescriptor(String JavaDoc uri){
52         m_uri = uri;
53     }
54
55     /**
56      * Returns the uri.
57      * @return the uri
58      */

59     public String JavaDoc getKey(){
60         return m_uri;
61     }
62
63     /**
64      * Compares the overgiven object with this object.
65      *
66      * @return true, if the object is identically else it returns false.
67      */

68     public boolean equals(Object JavaDoc obj) {
69         // check if the object is a CmsUriDescriptor object
70
if (obj instanceof CmsUriDescriptor) {
71             // same key?
72
if (((CmsUriDescriptor)obj).getKey().equals(m_uri) ){
73                 return true;
74             }
75         }
76         return false;
77     }
78
79     /**
80      * We have to return a hashcode for the hashtable. We can use the hashcode
81      * from the String uri.
82      * @return The hashCode.
83      */

84     public int hashCode(){
85         return m_uri.hashCode();
86     }
87
88     /**
89      * toString methode
90      */

91     public String JavaDoc toString(){
92         return m_uri;
93     }
94
95 }
Popular Tags