Source code: com/hp/hpl/jena/rdf/model/Alt.java
1 /*
2 * (c) Copyright 2000, 2001, 2002, 2003, 2004, 2005 Hewlett-Packard Development Company, LP
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * 3. The name of the author may not be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15
16 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
17 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
18 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
20 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
25 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 *
27 * Alt.java
28 *
29 * Created on 26 July 2000, 15:24
30 */
31
32 package com.hp.hpl.jena.rdf.model;
33
34 /** <p>An RDF Alternative container.</p>
35 *
36 * <p>This interface defines methods for accessing RDF Alternative resources.
37 * These methods operate on the RDF statements contained in a model. The
38 * Alternative implementation may cache state from the underlying model, so
39 * objects should not be added to or removed from the Alternative by directly
40 * manipulating its properties, whilst the Alternative is being
41 * accessed through this interface.</p>
42 *
43 * <p>When a member is deleted from an Alternative using this interface, or an
44 * iterator returned through this interface, all the other members with
45 * higher ordinals are renumbered using an implementation dependendent
46 * algorithm.</p>
47 *
48 * <p>This interface provides methods supporting typed literals. This means
49 * that methods are provided which will translate a built in type, or an
50 * object to an RDF Literal. This translation is done by invoking the
51 * <CODE>toString()</CODE> method of the object, or its built in equivalent.
52 * The reverse translation is also supported. This is built in for built
53 * in types. Factory objects, provided by the application, are used
54 * for application objects.</p>
55 * <p>This interface provides methods for supporting enhanced resources. An
56 * enhanced resource is a resource to which the application has added
57 * behaviour. RDF containers are examples of enhanced resources built in
58 * to this package. Enhanced resources are supported by encapsulating a
59 * resource created by an implementation in another class which adds
60 * the extra behaviour. Factory objects are used to construct such
61 * enhanced resources.</p>
62 * @author bwm
63 * @version Release='$Name: $' Revision='$Revision: 1.8 $' Date='$Date: 2005/02/21 12:13:35 $'
64 */
65
66
67 public interface Alt extends Container {
68
69 /** Set the default value of this container.
70 * @param o The value to be set.
71 * @return This object to permit cascading calls.
72 */
73 public Alt setDefault(RDFNode o);
74 /** Set the default value of this container.
75 * @param o The value to be set.
76 * @return This object to permit cascading calls.
77 */
78 public Alt setDefault(boolean o);
79 /** Set the default value of this container.
80 * @param o The value to be set.
81 * @return This object to permit cascading calls.
82 */
83 public Alt setDefault(long o);
84 /** Set the default value of this container.
85 * @param o The value to be set.
86 * @return This object to permit cascading calls.
87 */
88 public Alt setDefault(char o);
89 /** Set the default value of this container.
90 * @param o The value to be set.
91 * @return This object to permit cascading calls.
92 */
93 public Alt setDefault(float o);
94 /** Set the default value of this container.
95 * @param o The value to be set.
96 * @return This object to permit cascading calls.
97 */
98 public Alt setDefault(double o);
99 /** Set the default value of this container.
100 * @param o The value to be set.
101 * @return This object to permit cascading calls.
102 */
103 public Alt setDefault(String o);
104 /** Set the default value of this container.
105 * @param o The value to be set.
106 * @return This object to permit cascading calls.
107 */
108 public Alt setDefault(String o, String l);
109 /** Set the default value of this container.
110 * @param o The value to be set.
111 * @return This object to permit cascading calls.
112 */
113 public Alt setDefault(Object o);
114
115 /** Return the default value for this resource.
116 * @return the default value for this resource.
117 */
118 public RDFNode getDefault();
119 /** Return the default value for this resource.
120 * @return the default value for this resource interpreted as the return
121 * type.
122 */
123 public Resource getDefaultResource();
124 /** Return the default value for this resource.
125 * @return the default value for this resource interpreted as the return
126 * type.
127 */
128 public Literal getDefaultLiteral();
129 /** Return the default value for this resource.
130 * @return the default value for this resource interpreted as the return
131 * type.
132 */
133 public boolean getDefaultBoolean();
134 /** Return the default value for this resource.
135 * @return the default value for this resource interpreted as the return
136 * type.
137 */
138 public byte getDefaultByte();
139 /** Return the default value for this resource.
140 * @return the default value for this resource interpreted as the return
141 * type.
142 */
143 public short getDefaultShort();
144 /** Return the default value for this resource.
145 * @return the default value for this resource interpreted as the return
146 * type.
147 */
148 public int getDefaultInt();
149 /** Return the default value for this resource.
150 * @return the default value for this resource interpreted as the return
151 * type.
152 */
153 public long getDefaultLong();
154 /** Return the default value for this resource.
155 * @return the default value for this resource interpreted as the return
156 * type.
157 */
158 public char getDefaultChar();
159 /** Return the default value for this resource.
160 * @return the default value for this resource interpreted as the return
161 * type.
162 */
163 public float getDefaultFloat();
164 /** Return the default value for this resource.
165 * @return the default value for this resource interpreted as the return
166 * type.
167 */
168 public double getDefaultDouble();
169 /** Return the default value for this resource.
170 * @return the default value for this resource interpreted as the return
171 * type.
172 */
173 public String getDefaultString();
174 /** Return the language of the default value for this resource.
175 * @return the language of the default value for this resource
176 */
177 public String getDefaultLanguage();
178 /** Return the default value for this resource.
179 *
180 * <p>The factory class f is used to create the object which is returned.
181 * </p>
182 * @return the default value for this resource interpreted as the return
183 * type.
184 * @param f A factory class which will be used to create the
185 * object returned.
186
187 */
188 public Resource getDefaultResource(ResourceF f);
189 /** Return the default value for this resource.
190 *
191 * <p>The object returned is created by calling the
192 * <CODE>createObject</CODE> method of the factory object <CODE>f</CODE>.
193 * </p>
194 * @return the default value for this resource as an object created
195 * by the factory object f.
196 * @param f A factory object used to create the object returned.
197
198 */
199 public Object getDefaultObject(ObjectF f);
200 /** Return the default value for this resource.
201 * @return the default value for this resource interpreted as the return
202 * type.
203 */
204 public Alt getDefaultAlt();
205 /** Return the default value for this resource.
206 * @return the default value for this resource interpreted as the return
207 * type.
208 */
209 public Bag getDefaultBag();
210 /** Return the default value for this resource.
211 * @return the default value for this resource interpreted as the return
212 * type.
213 */
214 public Seq getDefaultSeq();
215
216 /** Remove a value from the container.
217 * <p>The predicate of the statement <CODE>s</CODE> identifies the
218 * ordinal of the value to be removed. Once removed, the values in the
219 * container with a higher ordinal value are renumbered. The renumbering
220 * algorithm is implementation dependent.<p>
221 * @param s The statement to be removed from the model.
222 * @return this container to enable cascading calls.
223 */
224 public Container remove(Statement s);
225 }
226