KickJava   Java API By Example, From Geeks To Geeks.

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


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 28-Apr-2003
9  * Filename $RCSfile: EnumeratedClass.java,v $
10  * Revision $Revision: 1.15 $
11  * Release status $State: Exp $
12  *
13  * Last modified on $Date: 2005/02/21 12:04:27 $
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
26 // Imports
27
///////////////
28
import java.util.Iterator JavaDoc;
29
30 import com.hp.hpl.jena.rdf.model.*;
31 import com.hp.hpl.jena.rdf.model.Resource;
32 import com.hp.hpl.jena.util.iterator.ExtendedIterator;
33
34
35 /**
36  * <p>
37  * Encapsulates a class description representing a closed enumeration of individuals.
38  * </p>
39  *
40  * @author Ian Dickinson, HP Labs
41  * (<a HREF="mailto:Ian.Dickinson@hp.com" >email</a>)
42  * @version CVS $Id: EnumeratedClass.java,v 1.15 2005/02/21 12:04:27 andy_seaborne Exp $
43  */

44 public interface EnumeratedClass
45     extends OntClass
46 {
47     // Constants
48
//////////////////////////////////
49

50
51     // External signature methods
52
//////////////////////////////////
53

54
55     // oneOf
56

57     /**
58      * <p>Assert that this class is exactly the enumeration of the given individuals. Any existing
59      * statements for <code>oneOf</code> will be removed.</p>
60      * @param en A list of individuals that defines the class extension for this class
61      * @exception OntProfileException If the {@link Profile#ONE_OF()} property is not supported in the current language profile.
62      */

63     public void setOneOf( RDFList en );
64
65     /**
66      * <p>Add an individual to the enumeration that defines the class extension of this class.</p>
67      * @param res An individual to add to the enumeration
68      * @exception OntProfileException If the {@link Profile#ONE_OF()} property is not supported in the current language profile.
69      */

70     public void addOneOf( Resource res );
71
72     /**
73      * <p>Add each individual from the given iteratation to the
74      * enumeration that defines the class extension of this class.</p>
75      * @param individuals An iterator over individuals
76      * @exception OntProfileException If the {@link Profile#ONE_OF()} property is not supported in the current language profile.
77      */

78     public void addOneOf( Iterator JavaDoc individuals );
79
80     /**
81      * <p>Answer a list of individuals that defines the extension of this class.</p>
82      * @return A list of individuals that is the class extension
83      * @exception OntProfileException If the {@link Profile#ONE_OF()} property is not supported in the current language profile.
84      */

85     public RDFList getOneOf();
86
87     /**
88      * <p>Answer an iterator over all of the individuals that are declared to be the class extension for
89      * this class. Each element of the iterator will be an {@link OntResource}.</p>
90      * @return An iterator over the individuals in the class extension
91      * @exception OntProfileException If the {@link Profile#ONE_OF()} property is not supported in the current language profile.
92      */

93     public ExtendedIterator listOneOf();
94
95     /**
96      * <p>Answer true if the given individual is one of the enumerated individuals in the class extension
97      * of this class.</p>
98      * @param res An individual to test
99      * @return True if the given individual is in the class extension for this class.
100      * @exception OntProfileException If the {@link Profile#ONE_OF()} property is not supported in the current language profile.
101      */

102     public boolean hasOneOf( Resource res );
103     
104     /**
105      * <p>Remove the statement that this enumeration includes <code>res</code> among its members. If this statement
106      * is not true of the current model, nothing happens.</p>
107      * @param res A resource that may be declared to be part of this enumeration, and which is
108      * no longer one of the enumeration values.
109      */

110     public void removeOneOf( Resource res );
111     
112
113 }
114
115
116 /*
117     (c) Copyright 2002, 2003, 2004, 2005 Hewlett-Packard Development Company, LP
118     All rights reserved.
119
120     Redistribution and use in source and binary forms, with or without
121     modification, are permitted provided that the following conditions
122     are met:
123
124     1. Redistributions of source code must retain the above copyright
125        notice, this list of conditions and the following disclaimer.
126
127     2. Redistributions in binary form must reproduce the above copyright
128        notice, this list of conditions and the following disclaimer in the
129        documentation and/or other materials provided with the distribution.
130
131     3. The name of the author may not be used to endorse or promote products
132        derived from this software without specific prior written permission.
133
134     THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
135     IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
136     OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
137     IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
138     INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
139     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
140     DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
141     THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
142     (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
143     THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
144 */

145
Popular Tags