KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > hp > hpl > jena > rdf > arp > AResource


1 /*
2  * (c) Copyright 2001, 2003,2004, 2005 Hewlett-Packard Development Company, LP
3   [See end of file]
4   $Id: AResource.java,v 1.8 2005/02/21 12:09:01 andy_seaborne Exp $
5 */

6 package com.hp.hpl.jena.rdf.arp;
7
8 /**
9  * A URI or blank node reported to a {@link StatementHandler}.
10  * Note: equality (<code>.equals</code>) rather than identity
11  * (<code>==</code>) must be used to compare <code>AResource</code>s.
12  *
13  * @author <a HREF="mailto:Jeremy.Carroll@hp.com">Jeremy Carroll</a>
14  *
15 */

16 public interface AResource {
17         /* Undefined results (including an exception) if not isAnonymous().
18          * @return An identifier with file scope for this anonymous resource.
19          */

20     /** A string distinguishing this anonymous resource, from other anonymous resources.
21      * Undefined if <CODE>isAnonymous()</CODE> returns false.
22      * @return A gensym String starting "A", or "U" concatenated with the value of rdf:nodeID.
23      */

24         public String JavaDoc getAnonymousID();
25         
26     /** If the input file specifies a URI reference for this resource, return it.
27      * Not defined if <CODE>isAnonymous()</CODE> returns true.
28      * @return The URI reference of this resource.
29      */

30         public String JavaDoc getURI();
31     /** The user data allows the RDF application to store one Object with each blank node during parsing.
32      * This may help with garbage collect strategies when parsing huge files.
33      * No references to the user data are maintained after a blank node goes out of
34      * scope.
35      * <p>
36      * Jena 2.1 note: earlier versions had a bug, which permitted user data
37      * on some URIref nodes and not on others. The documentation did not indicate that it
38      * was supported only on blank nodes. The documentation has been fixed
39      * to match the code which now uniformly no longer supports URIref nodes.
40      * @return A user data object previously stored with setUserData; or null if none.
41      */

42         public Object JavaDoc getUserData();
43      /**
44       *
45       * @return True, if this is an anonymous resource with an explicit rdf:nodeID
46       */

47      public boolean hasNodeID();
48         /*
49          * @return true if this resource is anonymous
50          */

51     /** Was this resource not given a URI in the file.
52      * @return True if this resource is anonymous.
53      */

54         public boolean isAnonymous();
55     /** The user data allows the RDF application to store one Object with each blank node during parsing.
56      * This may help with garbage collect strategies when parsing huge files.
57      * No references to the user data are maintained after a blank node goes out of
58      * scope.
59      * <p>
60      * See note about large files in class documentation for {@link ARP}.
61      * <p>
62      * Jena 2.1 note: earlier versions had a bug, which permitted user data
63      * on some URIref nodes and not on others. The documentation did not indicate that it
64      * was supported only on blank nodes. The documentation has been fixed
65      * to match the code which now uniformly no longer supports URIref nodes.
66      * @param d A user data object which may be retrieved later with getUserData.
67      */

68          public void setUserData(Object JavaDoc d);
69
70 }
71
72 /*
73 * (c) Copyright 2001, 2003, 2004, 2005 Hewlett-Packard Development Company, LP
74     All rights reserved.
75
76     Redistribution and use in source and binary forms, with or without
77     modification, are permitted provided that the following conditions
78     are met:
79
80     1. Redistributions of source code must retain the above copyright
81        notice, this list of conditions and the following disclaimer.
82
83     2. Redistributions in binary form must reproduce the above copyright
84        notice, this list of conditions and the following disclaimer in the
85        documentation and/or other materials provided with the distribution.
86
87     3. The name of the author may not be used to endorse or promote products
88        derived from this software without specific prior written permission.
89
90     THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
91     IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
92     OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
93     IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
94     INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
95     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
96     DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
97     THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
98     (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
99     THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
100 */
Popular Tags