01: /*
02: * The contents of this file are subject to the
03: * Mozilla Public License Version 1.1 (the "License");
04: * you may not use this file except in compliance with the License.
05: * You may obtain a copy of the License at http://www.mozilla.org/MPL/
06: *
07: * Software distributed under the License is distributed on an "AS IS"
08: * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.
09: * 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: /**
22: * This interface is implemented by objects which represent the
23: * restrictions imposed on values of a <code>Property</code> object.
24: *
25: * @author Michael Bell
26: * @version $Revision: 1.1 $
27: *
28: */
29: public interface Range {
30:
31: /**
32: * Returns a <code>String</code> representation of the non class type
33: * restrictions on this range.
34: */
35: public String getDetails();
36:
37: /**
38: * Returns a class name restriction which will determine what type of
39: * objects may be included in this range.
40: */
41: public String getObject();
42:
43: /**
44: * Returns <code>true</code> if the specified object is a member of this
45: * range, that is meets the restrictions defined by this range.
46: *
47: * @param obj the object to validate
48: * @return <code>true</code> if the specified object is a member of this
49: * range
50: */
51: boolean isValid(Object obj);
52:
53: /**
54: * Sets the non class type restrictions from a <code>String</code>
55: * representation. The format of the <code>String</code> is dependent on the
56: * implementation.
57: *
58: * @param sDetails teh <code>String</code> representation of the non
59: * class type restrictions
60: */
61: void setDetails(String sDetails);
62:
63: /**
64: * Returns <code>true</code> if this range has been changed since population.
65: *
66: * @return <code>true</code> if this range has been changed since population
67: */
68: public boolean isChanged();
69:
70: /**
71: * Returns the <code>Class</code> for the property instance which can
72: * take values of this range.
73: *
74: * @return the <code>Class</code> for the property instance which can
75: * take values of this range.
76: * @throws ClassNotFoundException if the class loader can not find the
77: * property instance class
78: */
79: public Class getPropertyInstanceClass()
80: throws ClassNotFoundException;
81:
82: /**
83: * Returns a cloned version of this range.
84: *
85: * @return a cloned version of this range
86: */
87: Object clone();
88:
89: }
|