/** * override graphBaseFind to return an iterator that will report when * a deletion occurs. */ @Override protected final ExtendedIterator<Triple> graphBaseFind( Triple m ) { return SimpleEventManager.notifyingRemove( this, this._graphBaseFind( m ) ); }
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); } }
/** When the graph is constructed, copy the prefix mappings of both components into this prefix mapping. The prefix mapping doesn't change afterwards with the components, which might be regarded as a bug. */ public Dyadic( Graph L, Graph R ) { this.L = L; this.R = R; getPrefixMapping() .setNsPrefixes( L.getPrefixMapping() ) .setNsPrefixes( R.getPrefixMapping() ) ; }
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); } }
/** When the graph is constructed, copy the prefix mappings of both components into this prefix mapping. The prefix mapping doesn't change afterwards with the components, which might be regarded as a bug. */ public Dyadic( Graph L, Graph R ) { this.L = L; this.R = R; getPrefixMapping() .setNsPrefixes( L.getPrefixMapping() ) .setNsPrefixes( R.getPrefixMapping() ) ; }
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); } }
/** * override graphBaseFind to return an iterator that will report when * a deletion occurs. */ @Override protected final ExtendedIterator<Triple> graphBaseFind( Triple m ) { return SimpleEventManager.notifyingRemove( this, this._graphBaseFind( m ) ); }