KickJava   Java API By Example, From Geeks To Geeks.

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


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: BooleanClassDescription.java,v $
10  * Revision $Revision: 1.10 $
11  * Release status $State: Exp $
12  *
13  * Last modified on $Date: 2005/02/21 12:04:25 $
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 com.hp.hpl.jena.rdf.model.*;
29 import com.hp.hpl.jena.util.iterator.ExtendedIterator;
30
31 import java.util.*;
32
33
34 /**
35  * <p>
36  * Encapsulates a class description formed from a boolean combination of other
37  * class descriptions (ie union, intersection or complement).
38  * </p>
39  *
40  * @author Ian Dickinson, HP Labs
41  * (<a HREF="mailto:Ian.Dickinson@hp.com" >email</a>)
42  * @version CVS $Id: BooleanClassDescription.java,v 1.10 2005/02/21 12:04:25 andy_seaborne Exp $
43  */

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

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

55     // operand
56

57     /**
58      * <p>Assert that the operands for this boolean class expression are the classes
59      * in the given list. Any existing
60      * statements for the operator will be removed.</p>
61      * @param operands The list of operands to this expression.
62      * @exception OntProfileException If the operand property is not supported in the current language profile.
63      */

64     public void setOperands( RDFList operands );
65
66     /**
67      * <p>Add a class the operands of this boolean expression.</p>
68      * @param cls A class that will be added to the operands of this Boolean expression
69      * @exception OntProfileException If the operand property is not supported in the current language profile.
70      */

71     public void addOperand( Resource cls );
72
73     /**
74      * <p>Add all of the classes from the given iterator to the operands of this boolean expression.</p>
75      * @param classes A iterator over classes that will be added to the operands of this Boolean expression
76      * @exception OntProfileException If the operand property is not supported in the current language profile.
77      */

78     public void addOperands( Iterator classes );
79
80     /**
81      * <p>Answer the list of operands for this Boolean class expression.</p>
82      * @return A list of the operands of this expression.
83      * @exception OntProfileException If the operand property is not supported in the current language profile.
84      */

85     public RDFList getOperands();
86
87     /**
88      * <p>Answer an iterator over all of the clases that are the operands of this
89      * Boolean class expression. Each element of the iterator will be an {@link OntClass}.</p>
90      * @return An iterator over the operands of the expression.
91      * @exception OntProfileException If the operand property is not supported in the current language profile.
92      */

93     public ExtendedIterator listOperands();
94
95     /**
96      * <p>Answer true if this Boolean class expression has the given class as an operand.</p>
97      * @param cls A class to test
98      * @return True if the given class is an operand to this expression.
99      * @exception OntProfileException If the operand property is not supported in the current language profile.
100      */

101     public boolean hasOperand( Resource cls );
102     
103     /**
104      * <p>Remove the given resource from the operands of this class expression.</p>
105      * @param res An resource to be removed from the operands of this class expression
106      */

107     public void removeOperand( Resource res );
108     
109     
110     /**
111      * <p>Answer the property that is used to construct this boolean expression, for example
112      * {@link Profile#UNION_OF()}.</p>
113      * @return The property used to construct this Boolean class expression.
114      */

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

149
150
151
Popular Tags