org.jrdf.graph
Class Graphs

java.lang.Object
  extended by org.jrdf.graph.Graphs

public final class Graphs
extends Object

Static class that contains utility methods for handling graphs and manipulating them. Similar to Google's iterators class.


Method Summary
static boolean add(Collection<Triple> addTo, Graph graph, SubjectNode subjectNode, PredicateNode predicateNode, ObjectNode objectNode)
          Adds any matching triples to the collection.
static boolean add(Collection<Triple> addTo, Graph graph, Triple triple)
          Adds any matching triples to the collection.
static boolean addAll(Collection<Triple> addTo, Graph graph)
          Adds all the elements from the graph into the collection.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

addAll

public static boolean addAll(Collection<Triple> addTo,
                             Graph graph)
Adds all the elements from the graph into the collection.

Parameters:
addTo - the collection to add it to.
graph - the graph to use.
Returns:
if it has been modified or not.

add

public static boolean add(Collection<Triple> addTo,
                          Graph graph,
                          Triple triple)
Adds any matching triples to the collection.

Parameters:
addTo - the collection to add the results to.
graph - the graph to search.
triple - the triple to use to search.
Returns:
if any modification is made to the collection.

add

public static boolean add(Collection<Triple> addTo,
                          Graph graph,
                          SubjectNode subjectNode,
                          PredicateNode predicateNode,
                          ObjectNode objectNode)
Adds any matching triples to the collection.

Parameters:
addTo - the collection to add the results to.
graph - the graph to search.
subjectNode - the subject node to find.
predicateNode - the predicate node to find.
objectNode - the object node to find.
Returns:
if any modification is made to the collection.