KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > openharmonise > rm > resources > metadata > properties > ranges > URIRange


1 /*
2  * The contents of this file are subject to the
3  * Mozilla Public License Version 1.1 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at http://www.mozilla.org/MPL/
6  *
7  * Software distributed under the License is distributed on an "AS IS"
8  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.
9  * See the License for the specific language governing rights and
10  * limitations under the License.
11  *
12  * The Initial Developer of the Original Code is Simulacra Media Ltd.
13  * Portions created by Simulacra Media Ltd are Copyright (C) Simulacra Media Ltd, 2004.
14  *
15  * All Rights Reserved.
16  *
17  * Contributor(s):
18  */

19 package org.openharmonise.rm.resources.metadata.properties.ranges;
20
21 import java.net.URL JavaDoc;
22
23 import org.openharmonise.rm.metadata.GeneralPropertyInstance;
24
25
26 /**
27  * Class which represents a <code>Property</code> range which is
28  * restricted to <code>URL</code> values.
29  *
30  * @author Michael Bell
31  * @version $Revision: 1.2 $
32  *
33  */

34 public class URIRange extends AbstractRange {
35
36     /**
37      * URI range tag name
38      */

39     public final static String JavaDoc TAG_URI_RANGE = "URIRange";
40     
41
42     /**
43      * Constructs a new <code>URIRange</code>
44      */

45     public URIRange() {
46         super(URL JavaDoc.class.getName());
47     }
48
49     /**
50      * Constructs a <cod>URIRange</code> with restrictions
51      *
52      * @param sDetails a <code>String</code> representation of the restrictions
53      * for this range
54      */

55     public URIRange(String JavaDoc sDetails) {
56         super(URL JavaDoc.class.getName(), sDetails);
57
58     }
59
60     /* (non-Javadoc)
61      * @see org.openharmonise.rm.resources.metadata.properties.ranges.Range#isValid(java.lang.Object)
62      */

63     public boolean isValid(Object JavaDoc obj) {
64         return obj instanceof URL JavaDoc;
65     }
66
67     /* (non-Javadoc)
68      * @see java.lang.Object#equals(java.lang.Object)
69      */

70     public boolean equals(Object JavaDoc obj) {
71         boolean bResult = false;
72
73         if (obj instanceof URIRange) {
74             bResult = super.equals(obj);
75         }
76
77         return bResult;
78     }
79
80     /* (non-Javadoc)
81      * @see org.openharmonise.rm.resources.metadata.properties.ranges.Range#getPropertyInstanceClass()
82      */

83     public Class JavaDoc getPropertyInstanceClass() throws ClassNotFoundException JavaDoc {
84         return GeneralPropertyInstance.class;
85     }
86     
87     /* (non-Javadoc)
88      * @see org.openharmonise.rm.publishing.Publishable#getTagName()
89      */

90     public String JavaDoc getTagName() {
91         return TAG_URI_RANGE;
92     }
93 }
94
Popular Tags