|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface GraphListener
Interface for listening to graph-level update events. Each time the graph is poked to add or remove some triples, and after that poke has completed without throwing an exception, all the listeners attached to the Graph are informed about the poke.
The notifications are, in general, given before further changes to the graph are made. Listeners are discouraged from making further modifications to the same graph since that will invalidate this property for other listeners.
Some modifications may result in multiple notifications in some cases.
For example, a bulk notification with notifyAddArray(Graph, Triple[])
,
may, or may not, be accompanied by several notifyAddTriple(Graph, Triple)
notifications, one for each triple. If possible, Graph implementations
should avoid such duplicate notifications and only give the bulk notifications,
see GraphWithPerform
.
When these duplicate notifications occur, each should happen immediately
after the change it signifies is complete. Thus, in the previous example,
if the array has two triples, the pattern is:
notifyAddTriple(Graph, Triple)
for the first triple.notifyAddTriple(Graph, Triple)
for the second triple.notifyAddArray(Graph, Triple[])
for the array.To track all changes to a graph it is necessary to consider all the methods
in this interface, including notifyEvent(Graph, Object)
.
Method Summary | |
---|---|
void |
notifyAddArray(Graph g,
Triple[] triples)
Method called when an array of triples has been added to the graph. |
void |
notifyAddGraph(Graph g,
Graph added)
Method called when another graph g has been used to
specify the triples added to our attached graph. |
void |
notifyAddIterator(Graph g,
Iterator<Triple> it)
Method called when an iterator [of triples] has been added to the graph |
void |
notifyAddList(Graph g,
List<Triple> triples)
Method called when a list [of triples] has been added to the graph. |
void |
notifyAddTriple(Graph g,
Triple t)
Method called when a single triple has been added to the graph. |
void |
notifyDeleteArray(Graph g,
Triple[] triples)
Method called when an array of triples has been deleted from the graph. |
void |
notifyDeleteGraph(Graph g,
Graph removed)
Method to call when another graph has been used to specify the triples deleted from our attached graph. |
void |
notifyDeleteIterator(Graph g,
Iterator<Triple> it)
Method called when an iterator [of triples] has been deleted from the graph. |
void |
notifyDeleteList(Graph g,
List<Triple> L)
Method called when a list [of triples] has been deleted from the graph. |
void |
notifyDeleteTriple(Graph g,
Triple t)
Method called when a single triple has been deleted from the graph. |
void |
notifyEvent(Graph source,
Object value)
method to call for a general event. |
Method Detail |
---|
void notifyAddTriple(Graph g, Triple t)
void notifyAddArray(Graph g, Triple[] triples)
void notifyAddList(Graph g, List<Triple> triples)
void notifyAddIterator(Graph g, Iterator<Triple> it)
void notifyAddGraph(Graph g, Graph added)
g
has been used to
specify the triples added to our attached graph.
g
- the graph of triples addedvoid notifyDeleteTriple(Graph g, Triple t)
void notifyDeleteList(Graph g, List<Triple> L)
void notifyDeleteArray(Graph g, Triple[] triples)
void notifyDeleteIterator(Graph g, Iterator<Triple> it)
void notifyDeleteGraph(Graph g, Graph removed)
g
- the graph of triples addedvoid notifyEvent(Graph source, Object value)
value
is usually a GraphEvents
.
Special attention is drawn to GraphEvents.removeAll
and events whose GraphEvents.getTitle()
is "remove"
(see GraphEvents.remove(Node, Node, Node)
. These correspond
to the bulk operations BulkUpdateHandler.removeAll()
,
and BulkUpdateHandler.remove(Node, Node, Node)
, respectively.
Unlike other notifications, the listener cannot tell which triples
have been modified, since they have already been deleted by the time
this event is sent, and the event does not include a record of them.
value
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |