KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > hp > hpl > jena > rdf > model > Seq


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  * Seq.java
28  *
29  * Created on 26 July 2000, 15:24
30  */

31
32 package com.hp.hpl.jena.rdf.model;
33
34
35 /** RDF Sequence container.
36  *
37  * <p>This interface defines methods for accessing RDF Sequence resources.
38  * These methods operate on the RDF statements contained in a model. The
39  * Sequence implementation may cache state from the underlying model, so
40  * objects should not be added to or removed from the Sequence by directly
41  * manipulating its properties, whilst the Sequence is being
42  * accessed through this interface.</p>
43  *
44  * <p>When a member is deleted from a sequence using this interface, or an
45  * iterator returned through this interface, all the other members with
46  * higher ordinals are renumbered to one below what they previously were.</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.10 $' Date='$Date: 2005/02/21 12:14:26 $'
64  */

65 public interface Seq extends Container {
66     
67     /** Insert a new member into the sequence at the specified position.
68      *
69      * <p>The existing member at that position, and all others with higher indexes,
70      * have their index increased by one.</p>
71      * @param index The index of the new member,
72      * @param o The member to be added.
73      .
74      * @return this object to enable cascading of method calls.
75      */

76     public Seq add(int index, RDFNode o) ;
77     
78     /** Insert a new member into the sequence at the specified position.
79      *
80      * <p>The existing member at that position, and all others with higher indexes,
81      * have their index increased by one.</p>
82      * @param index The index of the new member,
83      * @param o The member to be added.
84      .
85      * @return this object to enable cascading of method calls.
86      */

87     public Seq add(int index, boolean o) ;
88     
89     /** Insert a new member into the sequence at the specified position.
90      *
91      * <p>The existing member at that position, and all others with higher indexes,
92      * have their index increased by one.</p>
93      * @param index The index of the new member,
94      * @param o The member to be added.
95      .
96      * @return this object to enable cascading of method calls.
97      */

98     public Seq add(int index, long o) ;
99     
100     /** Insert a new member into the sequence at the specified position.
101      *
102      * <p>The existing member at that position, and all others with higher indexes,
103      * have their index increased by one.</p>
104      * @param index The index of the new member,
105      * @param o The member to be added.
106      .
107      * @return this object to enable cascading of method calls.
108      */

109     public Seq add(int index, char o) ;
110     
111     /** Insert a new member into the sequence at the specified position.
112      *
113      * <p>The existing member at that position, and all others with higher indexes,
114      * have their index increased by one.</p>
115      * @param index The index of the new member,
116      * @param o The member to be added.
117      .
118      * @return this object to enable cascading of method calls.
119      */

120     public Seq add(int index, float o) ;
121     
122     /** Insert a new member into the sequence at the specified position.
123      *
124      * <p>The existing member at that position, and all others with higher indexes,
125      * have their index increased by one.</p>
126      * @param index The index of the new member,
127      * @param o The member to be added.
128      .
129      * @return this object to enable cascading of method calls.
130      */

131     public Seq add(int index, double o) ;
132     
133     /** Insert a new member into the sequence at the specified position.
134      *
135      * <p>The existing member at that position, and all others with higher indexes,
136      * have their index increased by one.</p>
137      * @param index The index of the new member,
138      * @param o The member to be added.
139      .
140      * @return this object to enable cascading of method calls.
141      */

142     public Seq add(int index, String JavaDoc o) ;
143     
144     /** Insert a new member into the sequence at the specified position.
145      *
146      * <p>The existing member at that position, and all others with higher indexes,
147      * have their index increased by one.</p>
148      * @param index The index of the new member,
149      * @param o The member to be added.
150      * @param l the langauge of the value added
151      .
152      * @return this object to enable cascading of method calls.
153      */

154     public Seq add(int index, String JavaDoc o, String JavaDoc l) ;
155     
156     /** Insert a new member into the sequence at the specified position.
157      *
158      * <p>The existing member at that position, and all others with higher indexes,
159      * have their index increased by one.</p>
160      * @param index The index of the new member,
161      * @param o The member to be added.
162      .
163      * @return this object to enable cascading of method calls.
164      */

165     public Seq add(int index, Object JavaDoc o) ;
166     
167     /** Get the member at a given index.
168      *
169      * @param index The index of the required member.
170      .
171      * @return The member at the given index.
172      */

173     public boolean getBoolean(int index) ;
174     
175     /** Get the member at a given index.
176      *
177      * @param index The index of the required member.
178      .
179      * @return The member at the given index.
180      */

181     public byte getByte(int index) ;
182     
183     /** Get the member at a given index.
184      *
185      * @param index The index of the required member.
186      .
187      * @return The member at the given index.
188      */

189     public short getShort(int index) ;
190     
191     /** Get the member at a given index.
192      *
193      * @param index The index of the required member.
194      .
195      * @return The member at the given index.
196      */

197     public int getInt(int index) ;
198     
199     /** Get the member at a given index.
200      *
201      * @param index The index of the required member.
202      .
203      * @return The member at the given index.
204      */

205     public long getLong(int index) ;
206     
207     /** Get the member at a given index.
208      *
209      * @param index The index of the required member.
210      .
211      * @return The member at the given index.
212      */

213     public char getChar(int index) ;
214     
215     /** Get the member at a given index.
216      *
217      * @param index The index of the required member.
218      .
219      * @return The member at the given index.
220      */

221     public float getFloat(int index) ;
222     
223     /** Get the member at a given index.
224      *
225      * @param index The index of the required member.
226      .
227      * @return The member at the given index.
228      */

229     public double getDouble(int index) ;
230     
231     /** Get the member at a given index.
232      *
233      * @param index The index of the required member.
234      .
235      * @return The member at the given index.
236      */

237     public String JavaDoc getString(int index) ;
238     
239     /** Get the language of the member at a given index.
240      *
241      * @param index The index of the required member.
242      .
243      * @return The member at the given index.
244      */

245     public String JavaDoc getLanguage(int index) ;
246     
247     /** Get the member at a given index.
248      *
249      * <p>The supplied factory object is used to created the object return.</p>
250      * @return The member at the given index.
251      * @param index The index of the required member.
252      * @param f A factory object used to create the returned object.
253      .
254      */

255     public Object JavaDoc getObject(int index, ObjectF f) ;
256     
257     /** Get the member at a given index.
258      *
259      * <p>The supplied factory object is used to create the returned object.</p>
260      * @return The member at the given index.
261      * @param index The index of the required member.
262      * @param f The factory object used to create the returned object.
263      .
264      */

265     public Resource getResource(int index, ResourceF f) ;
266     
267     /** Get the member at a given index.
268      *
269      * @param index The index of the required member.
270      .
271      * @return The member at the given index.
272      */

273     public Literal getLiteral(int index) ;
274     
275     /** Get the member at a given index.
276      *
277      * @param index The index of the required member.
278      .
279      * @return The member at the given index.
280      */

281     public Resource getResource(int index) ;
282     
283     /** Get the member at a given index.
284      *
285      * @param index The index of the required member.
286      .
287      * @return The member at the given index.
288      */

289     public RDFNode getObject(int index) ;
290     
291     /** Get the member at a given index.
292      *
293      * @param index The index of the required member.
294      .
295      * @return The member at the given index.
296      */

297     public Bag getBag(int index) ;
298     
299     /** Get the member at a given index.
300      *
301      * @param index The index of the required member.
302      .
303      * @return The member at the given index.
304      */

305     public Alt getAlt(int index) ;
306     
307     /** Get the member at a given index.
308      *
309      * @param index The index of the required member.
310      .
311      * @return The member at the given index.
312      */

313     public Seq getSeq(int index) ;
314
315     /** Remove the member at the specified index.
316      *
317      * <p>All other members with a higher index will have their index reduced by
318      * one.</p>
319      * @param index The index of the member to be removed.
320      .
321      * @return this object to enable cascading of method calls.
322      */

323     public Seq remove(int index) ;
324     
325     /** Return the index of a given member of the sequence.
326      *
327      * <p>If more the the same value appears more than once in the sequence,
328      * it is undefined which of the indexes will be returned.</p>
329      *
330      * <p>If the member is not found in this sequence, a value of 0 is returned.</p>
331      * @param o The member sought.
332      .
333      * @return an index of the member in this sequence or 0 if the
334      * member is not found in this sequence.
335      */

336     public int indexOf(RDFNode o) ;
337     
338     /** Return the index of a given member of the sequence.
339      *
340      * <p>If more the the same value appears more than once in the sequence,
341      * it is undefined which of the indexes will be returned.</p>
342      *
343      * <p>If the member is not found in this sequence, a value of 0 is returned.</p>
344      * @param o The member sought.
345      .
346      * @return an index of the member in this sequence or 0 if the
347      * member is not found in this sequence.
348      */

349     public int indexOf(boolean o) ;
350     
351     /** Return the index of a given member of the sequence.
352      *
353      * <p>If more the the same value appears more than once in the sequence,
354      * it is undefined which of the indexes will be returned.</p>
355      *
356      * <p>If the member is not found in this sequence, a value of 0 is returned.</p>
357      * @param o The member sought.
358      .
359      * @return an index of the member in this sequence or 0 if the
360      * member is not found in this sequence.
361      */

362     public int indexOf(long o) ;
363     
364     /** Return the index of a given member of the sequence.
365      *
366      * <p>If more the the same value appears more than once in the sequence,
367      * it is undefined which of the indexes will be returned.</p>
368      *
369      * <p>If the member is not found in this sequence, a value of 0 is returned.</p>
370      * @param o The member sought.
371      .
372      * @return an index of the member in this sequence or 0 if the
373      * member is not found in this sequence.
374      */

375     public int indexOf(char o) ;
376     
377     /** Return the index of a given member of the sequence.
378      *
379      * <p>If more the the same value appears more than once in the sequence,
380      * it is undefined which of the indexes will be returned.</p>
381      *
382      * <p>If the member is not found in this sequence, a value of 0 is returned.</p>
383      * @param o The member sought.
384      .
385      * @return an index of the member in this sequence or 0 if the
386      * member is not found in this sequence.
387      */

388     public int indexOf(float o) ;
389     
390     /** Return the index of a given member of the sequence.
391      *
392      * <p>If more the the same value appears more than once in the sequence,
393      * it is undefined which of the indexes will be returned.</p>
394      *
395      * <p>If the member is not found in this sequence, a value of 0 is returned.</p>
396      * @param o The member sought.
397      .
398      * @return an index of the member in this sequence or 0 if the
399      * member is not found in this sequence.
400      */

401     public int indexOf(double o) ;
402     
403     /** Return the index of a given member of the sequence.
404      *
405      * <p>If more the the same value appears more than once in the sequence,
406      * it is undefined which of the indexes will be returned.</p>
407      *
408      * <p>If the member is not found in this sequence, a value of 0 is returned.</p>
409      * @param o The member sought.
410      .
411      * @return an index of the member in this sequence or 0 if the
412      * member is not found in this sequence.
413      */

414     public int indexOf(String JavaDoc o) ;
415     
416     /** Return the index of a given member of the sequence.
417      *
418      * <p>If more the the same value appears more than once in the sequence,
419      * it is undefined which of the indexes will be returned.</p>
420      *
421      * <p>If the member is not found in this sequence, a value of 0 is returned.</p>
422      * @param o The member sought.
423      * @param l the language of the member sought
424      .
425      * @return an index of the member in this sequence or 0 if the
426      * member is not found in this sequence.
427      */

428     public int indexOf(String JavaDoc o, String JavaDoc l) ;
429     
430     /** Return the index of a given member of the sequence.
431      *
432      * <p>If more the the same value appears more than once in the sequence,
433      * it is undefined which of the indexes will be returned.</p>
434      *
435      * <p>If the member is not found in this sequence, a value of 0 is returned.</p>
436      * @param o The member sought.
437      .
438      * @return an index of the member in this sequence or 0 if the
439      * member is not found in this sequence.
440      */

441     public int indexOf(Object JavaDoc o) ;
442     
443     /** Set the value at a given index in the sequence.
444      *
445      * <p>If the index is not in the range 1 to the size of the
446      * sequence, then an exception is raised.</p>
447      * @param index The index whose member is to be set.
448      * @param o The value to be set.
449      * @throws SeqIndexBoundsException
450      * @return this object to enable cascading method calls.
451      */

452     public Seq set(int index, RDFNode o) ;
453     
454     /** Set the value at a given index in the sequence.
455      *
456      * <p>If the index is not in the range 1 to the size of the
457      * sequence, then a Jena exception is raised.</p>
458      * @param index The index whose member is to be set.
459      * @param o The value to be set.
460      * @throws SeqIndexBoundsException
461      * @return this object to enable cascading method calls.
462      */

463     public Seq set(int index, boolean o) ;
464     
465     /** Set the value at a given index in the sequence.
466      *
467      * <p>If the index is not in the range 1 to the size of the
468      * sequence, then a Jena exception is raised.</p>
469      * @param index The index whose member is to be set.
470      * @param o The value to be set.
471      * @throws SeqIndexBoundsException
472      * @return this object to enable cascading method calls.
473      */

474     public Seq set(int index, long o) ;
475     
476     /** Set the value at a given index in the sequence.
477      *
478      * <p>If the index is not in the range 1 to the size of the
479      * sequence, then a Jena exception is raised.</p>
480      * @param index The index whose member is to be set.
481      * @param o The value to be set.
482      * @throws SeqIndexBoundsException
483      * @return this object to enable cascading method calls.
484      */

485     public Seq set(int index, char o) ;
486     
487     /** Set the value at a given index in the sequence.
488      *
489      * <p>If the index is not in the range 1 to the size of the
490      * sequence, then a Jena exception is raised.</p>
491      * @param index The index whose member is to be set.
492      * @param o The value to be set.
493      * @throws SeqIndexBoundsException
494      * @return this object to enable cascading method calls.
495      */

496     public Seq set(int index, float o) ;
497     
498     /** Set the value at a given index in the sequence.
499      *
500      * <p>If the index is not in the range 1 to the size of the
501      * sequence, then a Jena exception is raised.</p>
502      * @param index The index whose member is to be set.
503      * @param o The value to be set.
504      * @throws SeqIndexBoundsException
505      * @return this object to enable cascading method calls.
506      */

507     public Seq set(int index, double o) ;
508     
509     /** Set the value at a given index in the sequence.
510      *
511      * <p>If the index is not in the range 1 to the size of the
512      * sequence, then a Jena exception is raised.</p>
513      * @param index The index whose member is to be set.
514      * @param o The value to be set.
515      * @throws SeqIndexBoundsException
516      * @return this object to enable cascading method calls.
517      */

518     public Seq set(int index, String JavaDoc o) ;
519     
520     /** Set the value at a given index in the sequence.
521      *
522      * <p>If the index is not in the range 1 to the size of the
523      * sequence, then a Jena exception is raised.</p>
524      * @param index The index whose member is to be set.
525      * @param o The value to be set.
526      * @param l The language of the value set.
527      * @throws SeqIndexBoundsException
528      * @return this object to enable cascading method calls.
529      */

530     public Seq set(int index, String JavaDoc o, String JavaDoc l) ;
531     
532     /** Set the value at a given index in the sequence.
533      *
534      * <p>If the index is not in the range 1 to the size of the
535      * sequence, then a Jena exception is raised.</p>
536      * @param index The index whose member is to be set.
537      * @param o The value to be set.
538      * @throws SeqIndexBoundsException
539      * @return this object to enable cascading method calls.
540      */

541     public Seq set(int index, Object JavaDoc o) ;
542 }
543
544
Popular Tags