KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > hp > hpl > jena > graph > impl > SimpleReifierFragmentHandler


1 /*
2   (c) Copyright 2004, 2005 Hewlett-Packard Development Company, LP, all rights reserved.
3   [See end of file]
4   $Id: SimpleReifierFragmentHandler.java,v 1.3 2005/02/21 11:52:11 andy_seaborne Exp $
5 */

6 package com.hp.hpl.jena.graph.impl;
7
8 import com.hp.hpl.jena.graph.Node;
9 import com.hp.hpl.jena.graph.Triple;
10
11 public abstract class SimpleReifierFragmentHandler implements ReifierFragmentHandler
12     {
13     int which;
14     SimpleReifierFragmentsMap map;
15     
16     public SimpleReifierFragmentHandler( SimpleReifierFragmentsMap map, int n )
17         { which = n; this.map = map; }
18     
19     public abstract boolean clashesWith( ReifierFragmentsMap map, Node fragmentObject, Triple reified );
20     
21     public boolean clashedWith( Node fragmentObject, Triple reified )
22         {
23         if (clashesWith( map, fragmentObject, reified ))
24             {
25             map.putAugmentedTriple( this, reified.getSubject(), fragmentObject, reified );
26             return true;
27             }
28         else
29             return false;
30         }
31     
32     public Triple reifyIfCompleteQuad( Triple fragment, Node tag, Node object )
33         {
34         return map.reifyCompleteQuad( this, fragment, tag, object );
35         }
36     
37     /**
38      * @param tag
39      * @param already
40      * @param fragment
41      * @return
42      */

43     public Triple removeFragment( Node tag, Triple already, Triple fragment )
44         {
45         return map.removeFragment( this, tag, already, fragment );
46         }
47     }
48
49 /*
50     (c) Copyright 2004, 2005 Hewlett-Packard Development Company, LP
51     All rights reserved.
52     
53     Redistribution and use in source and binary forms, with or without
54     modification, are permitted provided that the following conditions
55     are met:
56     
57     1. Redistributions of source code must retain the above copyright
58        notice, this list of conditions and the following disclaimer.
59     
60     2. Redistributions in binary form must reproduce the above copyright
61        notice, this list of conditions and the following disclaimer in the
62        documentation and/or other materials provided with the distribution.
63     
64     3. The name of the author may not be used to endorse or promote products
65        derived from this software without specific prior written permission.
66     
67     THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
68     IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
69     OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
70     IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
71     INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
72     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
73     DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
74     THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
75     (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
76     THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
77 */
Popular Tags