org.apache.clerezza.rdf.core.impl
Class SimpleGraph

java.lang.Object
  extended by java.util.AbstractCollection<Triple>
      extended by org.apache.clerezza.rdf.core.impl.AbstractTripleCollection
          extended by org.apache.clerezza.rdf.core.impl.AbstractGraph
              extended by org.apache.clerezza.rdf.core.impl.SimpleGraph
All Implemented Interfaces:
Iterable<Triple>, Collection<Triple>, Graph, TripleCollection

public class SimpleGraph
extends AbstractGraph

Author:
reto

Constructor Summary
SimpleGraph(Iterator<Triple> tripleIter)
           
SimpleGraph(TripleCollection tripleCollection)
          Creates a graph with the triples in tripleCollection
SimpleGraph(TripleCollection tripleCollection, boolean tripleCollectionWillNeverChange)
          Creates a graph with the triples in tripleCollection.
 
Method Summary
 Iterator<Triple> performFilter(NonLiteral subject, UriRef predicate, Resource object)
          A subclass of AbstractTripleCollection should override this method instead of filter for graph event support to be added.
 int size()
           
 
Methods inherited from class org.apache.clerezza.rdf.core.impl.AbstractGraph
add, addAll, clear, equals, hashCode, remove, removeAll
 
Methods inherited from class org.apache.clerezza.rdf.core.impl.AbstractTripleCollection
addGraphListener, addGraphListener, contains, dispatchEvent, filter, iterator, performAdd, performRemove, removeGraphListener
 
Methods inherited from class java.util.AbstractCollection
containsAll, isEmpty, retainAll, toArray, toArray, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.clerezza.rdf.core.TripleCollection
addGraphListener, addGraphListener, filter, removeGraphListener
 
Methods inherited from interface java.util.Collection
contains, containsAll, isEmpty, iterator, retainAll, toArray, toArray
 

Constructor Detail

SimpleGraph

public SimpleGraph(TripleCollection tripleCollection)
Creates a graph with the triples in tripleCollection

Parameters:
tripleCollection - the collection of triples this Graph shall consist of

SimpleGraph

public SimpleGraph(TripleCollection tripleCollection,
                   boolean tripleCollectionWillNeverChange)
Creates a graph with the triples in tripleCollection. This construction allows to specify if the tripleCollection might change in future. If tripleCollectionWillNeverChange is set to true it will assume that the collection never changes, in this case the collection isn't copied making things more efficient.

Parameters:
tripleCollection - the collection of triples this Graph shall consist of
tripleCollectionWillNeverChange - true if the caller promises tripleCollection will never change

SimpleGraph

public SimpleGraph(Iterator<Triple> tripleIter)
Method Detail

size

public int size()
Specified by:
size in interface Collection<Triple>
Specified by:
size in class AbstractCollection<Triple>

performFilter

public Iterator<Triple> performFilter(NonLiteral subject,
                                      UriRef predicate,
                                      Resource object)
Description copied from class: AbstractTripleCollection
A subclass of AbstractTripleCollection should override this method instead of filter for graph event support to be added. The Iterator returned by filter will dispatch a GraphEvent after invoking the remove method of the iterator returned by this method.

Specified by:
performFilter in class AbstractTripleCollection
Returns:


Copyright © 2012 The Apache Software Foundation. All Rights Reserved.