com.hp.hpl.jena.graph.compose
Class MultiUnion

java.lang.Object
  extended bycom.hp.hpl.jena.graph.impl.GraphBase
      extended bycom.hp.hpl.jena.graph.compose.CompositionBase
          extended bycom.hp.hpl.jena.graph.compose.Polyadic
              extended bycom.hp.hpl.jena.graph.compose.MultiUnion
All Implemented Interfaces:
Graph

public class MultiUnion
extends Polyadic

A graph implementation that presents the union of zero or more subgraphs, one of which is distinguished as the updateable graph.

Version:
CVS $Id: MultiUnion.java,v 1.6 2003/06/17 15:21:50 chris-dollin Exp $
Author:
Ian Dickinson, HP Labs (email)

Field Summary
 
Fields inherited from interface com.hp.hpl.jena.graph.Graph
ADD, DELETE, ORDERED, SIZE
 
Constructor Summary
MultiUnion()
           Construct a union of exactly no sub graphs.
MultiUnion(Graph[] graphs)
           Construct a union of all of the given graphs
MultiUnion(java.util.Iterator graphs)
           Construct a union of all of the given graphs.
 
Method Summary
 void add(Triple t)
           Add the given triple to the union model; the actual component model to be updated will be the designated (or default) updateable graph.
 boolean contains(Triple t)
           Answer true if at least one of the graphs in this union contain the given triple.
 void delete(Triple t)
           Delete the given triple from the union model; the actual component model to be updated will be the designated (or default) updateable graph.
 ExtendedIterator find(TripleMatch t)
           Answer an iterator over the triples in the union of the graphs in this composition.
 
Methods inherited from class com.hp.hpl.jena.graph.compose.Polyadic
addGraph, capabilities, close, dependsOn, getBaseGraph, getSubGraphs, removeGraph, setBaseGraph
 
Methods inherited from class com.hp.hpl.jena.graph.compose.CompositionBase
butNot, countIterator, ifIn, ifIn, recording, reject, rejecting, size
 
Methods inherited from class com.hp.hpl.jena.graph.impl.GraphBase
contains, find, getBulkUpdateHandler, getCapabilities, getEventManager, getPrefixMapping, getReifier, getTransactionHandler, isIsomorphicWith, notifyAdd, notifyDelete, performAdd, performDelete, queryHandler, toString, withReification
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MultiUnion

public MultiUnion()

Construct a union of exactly no sub graphs.


MultiUnion

public MultiUnion(Graph[] graphs)

Construct a union of all of the given graphs

Parameters:
graphs - An array of the sub-graphs of this union

MultiUnion

public MultiUnion(java.util.Iterator graphs)

Construct a union of all of the given graphs.

Parameters:
graphs - An iterator of the sub-graphs of this union. If graphs is a closable iterator, it will be automatically closed.
Method Detail

add

public void add(Triple t)

Add the given triple to the union model; the actual component model to be updated will be the designated (or default) updateable graph.

Parameters:
t - A triple to add to the union graph
Throws:
com.hp.hpl.jena.shared.JenaException - if the union does not contain any sub-graphs yet

delete

public void delete(Triple t)

Delete the given triple from the union model; the actual component model to be updated will be the designated (or default) updateable graph.

Parameters:
t - A triple to from the union graph
Throws:
com.hp.hpl.jena.shared.JenaException - if the union does not contain any sub-graphs yet
See Also:
Graph.delete(Triple)

contains

public boolean contains(Triple t)

Answer true if at least one of the graphs in this union contain the given triple.

Specified by:
contains in interface Graph
Overrides:
contains in class CompositionBase
Parameters:
t - A triple
Returns:
True if any of the graphs in the union contain t
See Also:
Graph.contains(Triple)

find

public ExtendedIterator find(TripleMatch t)

Answer an iterator over the triples in the union of the graphs in this composition. Note that the requirement to remove duplicates from the union means that this will be an expensive operation for large (and especially for persistent) graphs.

Parameters:
t - The matcher to match against
Returns:
An iterator of all triples matching t in the union of the graphs.
See Also:
Graph.find(TripleMatch)


Copyright © 2001-2003 Hewlett-Packard. All Rights Reserved.