001: /*
002: (c) Copyright 2004, 2005, 2006, 2007, 2008 Hewlett-Packard Development Company, LP, all rights reserved.
003: [See end of file]
004: $Id: ReifierTripleMap.java,v 1.9 2008/01/02 12:05:16 andy_seaborne Exp $
005: */
006:
007: package com.hp.hpl.jena.graph.impl;
008:
009: import com.hp.hpl.jena.graph.*;
010: import com.hp.hpl.jena.util.iterator.ExtendedIterator;
011:
012: /**
013: ReifierTripleMap - an interface that describes how SimpleReifier manages
014: complete reified statements.
015: @author kers
016: */
017: public interface ReifierTripleMap {
018: /**
019: Answer the triple (ie reified statement) that is bound to this node, or
020: null if there's no such triple.
021: */
022: public abstract Triple getTriple(Node tag);
023:
024: /**
025: Answer true iff we have a reified triple <code>t</code> -- ie, getTriple would
026: not return <code>null</code>.
027: */
028: public abstract boolean hasTriple(Triple t);
029:
030: /**
031: Bind the triple <code>value</code> to the node <code>key</code> and
032: answer that triple. An implementation may assume that <code>key</code>
033: is not already bound.
034: */
035: public abstract Triple putTriple(Node key, Triple value);
036:
037: /**
038: Unbind <code>key</code> from any triple already bound to it.
039: */
040: public abstract void removeTriple(Node key);
041:
042: /**
043: <code>key</code> should already be bound to <code>triple</code>; that
044: binding is removed.
045: */
046: public abstract void removeTriple(Node key, Triple value);
047:
048: /**
049: Remove every binding tag -> <code>triple</code>.
050: */
051: public abstract void removeTriple(Triple triple);
052:
053: /**
054: Answer an iterator over all the quadlets that match <code>m</code> that
055: correspond to complete reified triples held in this map.
056: */
057: public ExtendedIterator find(TripleMatch m);
058:
059: /**
060: Answer the number of quadlets in this map.
061: */
062: public int size();
063:
064: /**
065: Answer an iterator over all the bound tags in this map.
066: */
067: public abstract ExtendedIterator tagIterator();
068:
069: /**
070: Answer an iterator over all the tags in this map that are bound to
071: <code>t</code>.
072: */
073: public abstract ExtendedIterator tagIterator(Triple t);
074:
075: /**
076: Clear away all the triples.
077: */
078: public void clear();
079: }
080:
081: /*
082: (c) Copyright 2004, 2005, 2006, 2007, 2008 Hewlett-Packard Development Company, LP
083: All rights reserved.
084:
085: Redistribution and use in source and binary forms, with or without
086: modification, are permitted provided that the following conditions
087: are met:
088:
089: 1. Redistributions of source code must retain the above copyright
090: notice, this list of conditions and the following disclaimer.
091:
092: 2. Redistributions in binary form must reproduce the above copyright
093: notice, this list of conditions and the following disclaimer in the
094: documentation and/or other materials provided with the distribution.
095:
096: 3. The name of the author may not be used to endorse or promote products
097: derived from this software without specific prior written permission.
098:
099: THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
100: IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
101: OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
102: IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
103: INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
104: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
105: DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
106: THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
107: (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
108: THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
109: */
|