org.topbraid.core.instancecount
Interface IInstanceCountProvider

All Known Implementing Classes:
InstanceCountProvider

public interface IInstanceCountProvider

An object that keeps track of the number of instances (rdf:type triples) in each registered Graph. One instance of this is managed per IChangeEngine, and this way also per ISession.

Author:
Holger Knublauch

Method Summary
 void addListener(IInstanceCountListener listener)
           
 void clear()
          Resets any cached values.
 void dispose()
          Should be called to enable this to remove itself as listener.
 java.lang.Integer getInstanceCount(com.hp.hpl.jena.graph.Graph graph, com.hp.hpl.jena.graph.Node classNode)
          Gets the number of known instances of a given class in a given Graph.
 void refresh(TripleChangeRecord[] records, boolean undone)
          Called by the IChangeEngine so that this can update the counts from the change records.
 void removeGraph(com.hp.hpl.jena.graph.Graph graph)
           
 void removeListener(IInstanceCountListener listener)
           
 

Method Detail

addListener

void addListener(IInstanceCountListener listener)

clear

void clear()
Resets any cached values.


dispose

void dispose()
Should be called to enable this to remove itself as listener.


getInstanceCount

java.lang.Integer getInstanceCount(com.hp.hpl.jena.graph.Graph graph,
                                   com.hp.hpl.jena.graph.Node classNode)
Gets the number of known instances of a given class in a given Graph.

Parameters:
graph - the Graph to get the number of instances
classNode - the Node of the class
Returns:
the number of instances, null (unknown) or a negative number (e.g. -1 means "at least 1")

refresh

void refresh(TripleChangeRecord[] records,
             boolean undone)
Called by the IChangeEngine so that this can update the counts from the change records.

Parameters:
records - the records
undone - true if the records have been undone

removeGraph

void removeGraph(com.hp.hpl.jena.graph.Graph graph)

removeListener

void removeListener(IInstanceCountListener listener)