KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > hp > hpl > jena > db > impl > DBPropPrefix


1 /*
2   (c) Copyright 2003, 2004, 2005 Hewlett-Packard Development Company, LP
3   [See end of file]
4 */

5
6 package com.hp.hpl.jena.db.impl;
7
8 import com.hp.hpl.jena.graph.*;
9 import com.hp.hpl.jena.util.iterator.ExtendedIterator;
10 import com.hp.hpl.jena.vocabulary.DB;
11
12 /**
13  *
14  * A wrapper to assist in getting and setting DB information from
15  * a persistent store.
16  *
17  * This is written in the style of enhanced nodes - no state is
18  * stored in the DBStoreDesc, instead all state is in the
19  * underlying graph and this is just provided as a convenience.
20  *
21  * (We don't use enhanced nodes because, since we control everything
22  * in the persistent store system description, we can avoid any
23  * need to handle polymorhphism).
24  *
25  * @since Jena 2.0
26  *
27  * @author csayers
28  * @version $Revision: 1.7 $
29  */

30 public class DBPropPrefix extends DBProp {
31
32     public static Node_URI prefixValue = (Node_URI)DB.prefixValue.getNode();
33     public static Node_URI prefixURI = (Node_URI)DB.prefixURI.getNode();
34     
35     public DBPropPrefix( SpecializedGraph g, String JavaDoc value, String JavaDoc uri) {
36         super( g, Node.createAnon());
37         putPropString(prefixValue, value);
38         putPropString(prefixURI, uri);
39     }
40     
41     public DBPropPrefix( SpecializedGraph g, Node n) {
42         super(g,n);
43     }
44         
45     public String JavaDoc getValue() { return getPropString( prefixValue); }
46     public String JavaDoc getURI() { return getPropString( prefixURI); }
47     
48
49     public ExtendedIterator listTriples() {
50         return DBProp.listTriples(graph, self);
51     }
52     public String JavaDoc toString()
53         { return "<[" + getValue() + "=" + getURI() + "]>" ; }
54 }
55
56 /*
57  * (c) Copyright 2002, 2003, 2004, 2005 Hewlett-Packard Development Company, LP
58  * All rights reserved.
59  *
60  * Redistribution and use in source and binary forms, with or without
61  * modification, are permitted provided that the following conditions
62  * are met:
63  * 1. Redistributions of source code must retain the above copyright
64  * notice, this list of conditions and the following disclaimer.
65  * 2. Redistributions in binary form must reproduce the above copyright
66  * notice, this list of conditions and the following disclaimer in the
67  * documentation and/or other materials provided with the distribution.
68  * 3. The name of the author may not be used to endorse or promote products
69  * derived from this software without specific prior written permission.
70
71  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
72  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
73  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
74  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
75  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
76  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
77  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
78  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
79  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
80  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
81  */
Popular Tags