KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > hp > hpl > jena > ontology > MaxCardinalityRestriction


1 /*****************************************************************************
2  * Source code information
3  * -----------------------
4  * Original author Ian Dickinson, HP Labs Bristol
5  * Author email Ian.Dickinson@hp.com
6  * Package Jena 2
7  * Web http://sourceforge.net/projects/jena/
8  * Created 08-May-2003
9  * Filename $RCSfile: MaxCardinalityRestriction.java,v $
10  * Revision $Revision: 1.6 $
11  * Release status $State: Exp $
12  *
13  * Last modified on $Date: 2005/02/21 12:04:29 $
14  * by $Author: andy_seaborne $
15  *
16  * (c) Copyright 2002, 2003, 2004, 2005 Hewlett-Packard Development Company, LP
17  * (see footer for full conditions)
18  *****************************************************************************/

19
20 // Package
21
///////////////
22
package com.hp.hpl.jena.ontology;
23
24
25 // Imports
26
///////////////
27

28 /**
29  * <p>
30  * A property restriction that requires the named property to have have at most
31  * the given number of values for a given instance to be a member of the class defined
32  * by the restriction.
33  * </p>
34  *
35  * @author Ian Dickinson, HP Labs
36  * (<a HREF="mailto:Ian.Dickinson@hp.com" >email</a>)
37  * @version CVS $Id: MaxCardinalityRestriction.java,v 1.6 2005/02/21 12:04:29 andy_seaborne Exp $
38  */

39 public interface MaxCardinalityRestriction
40     extends Restriction
41 {
42     // Constants
43
//////////////////////////////////
44

45
46     // External signature methods
47
//////////////////////////////////
48

49     // maxCardinality
50

51     /**
52      * <p>Assert that this restriction restricts the property to have the given
53      * maximum cardinality. Any existing statements for <code>maxCardinality</code>
54      * will be removed.</p>
55      * @param cardinality The maximum cardinality of the restricted property
56      * @exception OntProfileException If the {@link Profile#MAX_CARDINALITY()} property is not supported in the current language profile.
57      */

58     public void setMaxCardinality( int cardinality );
59
60     /**
61      * <p>Answer the maximum cardinality of the restricted property.</p>
62      * @return The maximum cardinality of the restricted property
63      * @exception OntProfileException If the {@link Profile#MAX_CARDINALITY()} property is not supported in the current language profile.
64      */

65     public int getMaxCardinality();
66
67     /**
68      * <p>Answer true if this property restriction has the given maximum cardinality.</p>
69      * @param cardinality The cardinality to test against
70      * @return True if the given cardinality is the max cardinality of the restricted property in this restriction
71      * @exception OntProfileException If the {@link Profile#MAX_CARDINALITY()} property is not supported in the current language profile.
72      */

73     public boolean hasMaxCardinality( int cardinality );
74     
75     /**
76      * <p>Remove the statement that this restriction has the given maximum cardinality
77      * for the restricted property. If this statement
78      * is not true of the current model, nothing happens.</p>
79      * @param cardinality A max cardinality value to be removed from this restriction
80      */

81     public void removeMaxCardinality( int cardinality );
82     
83
84
85 }
86
87
88 /*
89     (c) Copyright 2002, 2003, 2004, 2005 Hewlett-Packard Development Company, LP
90     All rights reserved.
91
92     Redistribution and use in source and binary forms, with or without
93     modification, are permitted provided that the following conditions
94     are met:
95
96     1. Redistributions of source code must retain the above copyright
97        notice, this list of conditions and the following disclaimer.
98
99     2. Redistributions in binary form must reproduce the above copyright
100        notice, this list of conditions and the following disclaimer in the
101        documentation and/or other materials provided with the distribution.
102
103     3. The name of the author may not be used to endorse or promote products
104        derived from this software without specific prior written permission.
105
106     THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
107     IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
108     OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
109     IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
110     INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
111     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
112     DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
113     THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
114     (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
115     THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
116 */

117
118
Popular Tags