public PelletGraphListener(final Graph rootGraph, final KnowledgeBase kb, final boolean enabled) { _rootGraph = rootGraph; _kb = kb; _enabled = enabled; if (enabled) collectLeafGraphs(rootGraph, Collections.<Graph> emptySet()); }
public PelletGraphListener(final Graph rootGraph, final KnowledgeBase kb, final boolean enabled) { _rootGraph = rootGraph; _kb = kb; _enabled = enabled; if (enabled) collectLeafGraphs(rootGraph, Collections.<Graph> emptySet()); }
public PelletGraphListener(final Graph rootGraph, final KnowledgeBase kb, final boolean enabled) { _rootGraph = rootGraph; _kb = kb; _enabled = enabled; if (enabled) collectLeafGraphs(rootGraph, Collections.<Graph> emptySet()); }
public void setEnabled(final boolean enabled) { if (_enabled == enabled) return; _enabled = enabled; _leafGraphs.clear(); _changedGraphs.clear(); _statementDeleted = false; if (enabled) collectLeafGraphs(_rootGraph, Collections.<Graph> emptySet()); else for (final Graph graph : _leafGraphs) graph.getEventManager().unregister(this); } }
public void setEnabled(final boolean enabled) { if (_enabled == enabled) return; _enabled = enabled; _leafGraphs.clear(); _changedGraphs.clear(); _statementDeleted = false; if (enabled) collectLeafGraphs(_rootGraph, Collections.<Graph> emptySet()); else for (final Graph graph : _leafGraphs) graph.getEventManager().unregister(this); } }
public void setEnabled(final boolean enabled) { if (_enabled == enabled) return; _enabled = enabled; _leafGraphs.clear(); _changedGraphs.clear(); _statementDeleted = false; if (enabled) collectLeafGraphs(_rootGraph, Collections.<Graph> emptySet()); else for (final Graph graph : _leafGraphs) graph.getEventManager().unregister(this); } }
public synchronized Set<Graph> getChangedGraphs() { final Set<Graph> prevLeaves = _leafGraphs; _leafGraphs = SetUtils.create(); collectLeafGraphs(_rootGraph, prevLeaves); for (final Graph prevLeaf : prevLeaves) if (!_leafGraphs.contains(prevLeaf)) { _statementDeleted = true; prevLeaf.getEventManager().unregister(this); } if (_statementDeleted) return null; return _changedGraphs; }
public synchronized Set<Graph> getChangedGraphs() { final Set<Graph> prevLeaves = _leafGraphs; _leafGraphs = SetUtils.create(); collectLeafGraphs(_rootGraph, prevLeaves); for (final Graph prevLeaf : prevLeaves) if (!_leafGraphs.contains(prevLeaf)) { _statementDeleted = true; prevLeaf.getEventManager().unregister(this); } if (_statementDeleted) return null; return _changedGraphs; }
public synchronized Set<Graph> getChangedGraphs() { final Set<Graph> prevLeaves = _leafGraphs; _leafGraphs = SetUtils.create(); collectLeafGraphs(_rootGraph, prevLeaves); for (final Graph prevLeaf : prevLeaves) if (!_leafGraphs.contains(prevLeaf)) { _statementDeleted = true; prevLeaf.getEventManager().unregister(this); } if (_statementDeleted) return null; return _changedGraphs; }
private void collectLeafGraphs(final Graph graph, final Set<Graph> prevLeaves) { if (graph instanceof Polyadic) { final Polyadic union = (Polyadic) graph; if (union.getBaseGraph() != null) collectLeafGraphs(union.getBaseGraph(), prevLeaves); for (final Graph graph2 : union.getSubGraphs()) collectLeafGraphs(graph2, prevLeaves); } else if (graph instanceof Dyadic) { final Dyadic dyadic = (Dyadic) graph; if (dyadic.getL() instanceof Graph) collectLeafGraphs((Graph) dyadic.getL(), prevLeaves); if (dyadic.getR() instanceof Graph) collectLeafGraphs((Graph) dyadic.getR(), prevLeaves); } else if (graph instanceof InfGraph) collectLeafGraphs(((InfGraph) graph).getRawGraph(), prevLeaves); else if (_leafGraphs.add(graph) && !prevLeaves.contains(graph)) { _changedGraphs.add(graph); graph.getEventManager().register(this); } }
private void collectLeafGraphs(final Graph graph, final Set<Graph> prevLeaves) { if (graph instanceof Polyadic) { final Polyadic union = (Polyadic) graph; if (union.getBaseGraph() != null) collectLeafGraphs(union.getBaseGraph(), prevLeaves); for (final Graph graph2 : union.getSubGraphs()) collectLeafGraphs(graph2, prevLeaves); } else if (graph instanceof Dyadic) { final Dyadic dyadic = (Dyadic) graph; if (dyadic.getL() instanceof Graph) collectLeafGraphs((Graph) dyadic.getL(), prevLeaves); if (dyadic.getR() instanceof Graph) collectLeafGraphs((Graph) dyadic.getR(), prevLeaves); } else if (graph instanceof InfGraph) collectLeafGraphs(((InfGraph) graph).getRawGraph(), prevLeaves); else if (_leafGraphs.add(graph) && !prevLeaves.contains(graph)) { _changedGraphs.add(graph); graph.getEventManager().register(this); } }
private void collectLeafGraphs(final Graph graph, final Set<Graph> prevLeaves) { if (graph instanceof Polyadic) { final Polyadic union = (Polyadic) graph; if (union.getBaseGraph() != null) collectLeafGraphs(union.getBaseGraph(), prevLeaves); for (final Graph graph2 : union.getSubGraphs()) collectLeafGraphs(graph2, prevLeaves); } else if (graph instanceof Dyadic) { final Dyadic dyadic = (Dyadic) graph; if (dyadic.getL() instanceof Graph) collectLeafGraphs((Graph) dyadic.getL(), prevLeaves); if (dyadic.getR() instanceof Graph) collectLeafGraphs((Graph) dyadic.getR(), prevLeaves); } else if (graph instanceof InfGraph) collectLeafGraphs(((InfGraph) graph).getRawGraph(), prevLeaves); else if (_leafGraphs.add(graph) && !prevLeaves.contains(graph)) { _changedGraphs.add(graph); graph.getEventManager().register(this); } }