001: /*
002: * (c) Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Hewlett-Packard Development Company, LP
003: * All rights reserved.
004: *
005: * Redistribution and use in source and binary forms, with or without
006: * modification, are permitted provided that the following conditions
007: * are met:
008: * 1. Redistributions of source code must retain the above copyright
009: * notice, this list of conditions and the following disclaimer.
010: * 2. Redistributions in binary form must reproduce the above copyright
011: * notice, this list of conditions and the following disclaimer in the
012: * documentation and/or other materials provided with the distribution.
013: * 3. The name of the author may not be used to endorse or promote products
014: * derived from this software without specific prior written permission.
015:
016: * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
017: * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
018: * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
019: * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
020: * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
021: * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
022: * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
023: * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
024: * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
025: * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
026: *
027: * Alt.java
028: *
029: * Created on 26 July 2000, 15:24
030: */
031:
032: package com.hp.hpl.jena.rdf.model;
033:
034: /** <p>An RDF Alternative container.</p>
035: *
036: * <p>This interface defines methods for accessing RDF Alternative resources.
037: * These methods operate on the RDF statements contained in a model. The
038: * Alternative implementation may cache state from the underlying model, so
039: * objects should not be added to or removed from the Alternative by directly
040: * manipulating its properties, whilst the Alternative is being
041: * accessed through this interface.</p>
042: *
043: * <p>When a member is deleted from an Alternative using this interface, or an
044: * iterator returned through this interface, all the other members with
045: * higher ordinals are renumbered using an implementation dependendent
046: * algorithm.</p>
047: *
048: * <p>This interface provides methods supporting typed literals. This means
049: * that methods are provided which will translate a built in type, or an
050: * object to an RDF Literal. This translation is done by invoking the
051: * <CODE>toString()</CODE> method of the object, or its built in equivalent.
052: * The reverse translation is also supported. This is built in for built
053: * in types. Factory objects, provided by the application, are used
054: * for application objects.</p>
055: * <p>This interface provides methods for supporting enhanced resources. An
056: * enhanced resource is a resource to which the application has added
057: * behaviour. RDF containers are examples of enhanced resources built in
058: * to this package. Enhanced resources are supported by encapsulating a
059: * resource created by an implementation in another class which adds
060: * the extra behaviour. Factory objects are used to construct such
061: * enhanced resources.</p>
062: * @author bwm
063: * @version Release='$Name: $' Revision='$Revision: 1.12 $' Date='$Date: 2008/01/02 12:05:46 $'
064: */
065:
066: public interface Alt extends Container {
067:
068: /** Set the default value of this container.
069: * @param o The value to be set.
070: * @return This object to permit cascading calls.
071: */
072: public Alt setDefault(RDFNode o);
073:
074: /** Set the default value of this container.
075: * @param o The value to be set.
076: * @return This object to permit cascading calls.
077: */
078: public Alt setDefault(boolean o);
079:
080: /** Set the default value of this container.
081: * @param o The value to be set.
082: * @return This object to permit cascading calls.
083: */
084: public Alt setDefault(long o);
085:
086: /** Set the default value of this container.
087: * @param o The value to be set.
088: * @return This object to permit cascading calls.
089: */
090: public Alt setDefault(char o);
091:
092: /** Set the default value of this container.
093: * @param o The value to be set.
094: * @return This object to permit cascading calls.
095: */
096: public Alt setDefault(float o);
097:
098: /** Set the default value of this container.
099: * @param o The value to be set.
100: * @return This object to permit cascading calls.
101: */
102: public Alt setDefault(double o);
103:
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);
109:
110: /** Set the default value of this container.
111: * @param o The value to be set.
112: * @return This object to permit cascading calls.
113: */
114: public Alt setDefault(String o, String l);
115:
116: /** Set the default value of this container.
117: * @param o The value to be set.
118: * @return This object to permit cascading calls.
119: */
120: public Alt setDefault(Object o);
121:
122: /** Return the default value for this resource.
123: * @return the default value for this resource.
124: */
125: public RDFNode getDefault();
126:
127: /** Return the default value for this resource.
128: * @return the default value for this resource interpreted as the return
129: * type.
130: */
131: public Resource getDefaultResource();
132:
133: /** Return the default value for this resource.
134: * @return the default value for this resource interpreted as the return
135: * type.
136: */
137: public Literal getDefaultLiteral();
138:
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 boolean getDefaultBoolean();
144:
145: /** Return the default value for this resource.
146: * @return the default value for this resource interpreted as the return
147: * type.
148: */
149: public byte getDefaultByte();
150:
151: /** Return the default value for this resource.
152: * @return the default value for this resource interpreted as the return
153: * type.
154: */
155: public short getDefaultShort();
156:
157: /** Return the default value for this resource.
158: * @return the default value for this resource interpreted as the return
159: * type.
160: */
161: public int getDefaultInt();
162:
163: /** Return the default value for this resource.
164: * @return the default value for this resource interpreted as the return
165: * type.
166: */
167: public long getDefaultLong();
168:
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 char getDefaultChar();
174:
175: /** Return the default value for this resource.
176: * @return the default value for this resource interpreted as the return
177: * type.
178: */
179: public float getDefaultFloat();
180:
181: /** Return the default value for this resource.
182: * @return the default value for this resource interpreted as the return
183: * type.
184: */
185: public double getDefaultDouble();
186:
187: /** Return the default value for this resource.
188: * @return the default value for this resource interpreted as the return
189: * type.
190: */
191: public String getDefaultString();
192:
193: /** Return the language of the default value for this resource.
194: * @return the language of the default value for this resource
195: */
196: public String getDefaultLanguage();
197:
198: /** Return the default value for this resource.
199: *
200: * <p>The factory class f is used to create the object which is returned.
201: * </p>
202: * @return the default value for this resource interpreted as the return
203: * type.
204: * @param f A factory class which will be used to create the
205: * object returned.
206:
207: */
208: public Resource getDefaultResource(ResourceF f);
209:
210: /** Return the default value for this resource.
211: *
212: * <p>The object returned is created by calling the
213: * <CODE>createObject</CODE> method of the factory object <CODE>f</CODE>.
214: * </p>
215: * @return the default value for this resource as an object created
216: * by the factory object f.
217: * @param f A factory object used to create the object returned.
218:
219: */
220: public Object getDefaultObject(ObjectF f);
221:
222: /** Return the default value for this resource.
223: * @return the default value for this resource interpreted as the return
224: * type.
225: */
226: public Alt getDefaultAlt();
227:
228: /** Return the default value for this resource.
229: * @return the default value for this resource interpreted as the return
230: * type.
231: */
232: public Bag getDefaultBag();
233:
234: /** Return the default value for this resource.
235: * @return the default value for this resource interpreted as the return
236: * type.
237: */
238: public Seq getDefaultSeq();
239:
240: /** Remove a value from the container.
241: * <p>The predicate of the statement <CODE>s</CODE> identifies the
242: * ordinal of the value to be removed. Once removed, the values in the
243: * container with a higher ordinal value are renumbered. The renumbering
244: * algorithm is implementation dependent.<p>
245: * @param s The statement to be removed from the model.
246: * @return this container to enable cascading calls.
247: */
248: public Container remove(Statement s);
249: }
|