Package com.hp.hpl.jena.mem

Examples of com.hp.hpl.jena.mem.TrackingTripleIterator


   */
  @Override
  protected ExtendedIterator graphBaseFind(TripleMatch m) {
    if (graph == null)
      createGraph();
    return new TrackingTripleIterator(filterTriples(convertNodes(graph
        .iterator()), m));
  }
View Full Code Here


     * Answer an iterator which wraps <code>i</code> to ensure that if a .remove()
     * is executed on it, the graph <code>g</code> will be notified.
    */
    public static ExtendedIterator<Triple> notifyingRemove( final Graph g, Iterator<Triple> i )
        {
        return new TrackingTripleIterator( i )
            {           
            protected final GraphEventManager gem = g.getEventManager();
            @Override
            public void remove()
                {
View Full Code Here

    }
  }

  @Override
  protected ExtendedIterator graphBaseFind(TripleMatch m) {
    return new TrackingTripleIterator(convert(filter(m)));
  }
View Full Code Here

    public void failingTestDoubleRemoveAll() {
        final Graph g = getGraph();
        if (g.getCapabilities().iteratorRemoveAllowed() ) {
            graphAdd(g,"c S d; e:ff GGG hhhh; _i J 27; Ell Em 'en'"  );
            Iterator<Triple> it = new TrackingTripleIterator(g.find(Triple.ANY)){
                @Override
                public void remove() {
                    super.remove(); // removes current
                    g.delete(current); // no-op.
                }
            };
            while (it.hasNext()) {
                it.next();
                it.remove();
            }
            assertTrue( g.isEmpty() );
        }
    }
View Full Code Here

        }
    }

    @Override
    protected ExtendedIterator graphBaseFind(TripleMatch m) {
        return new TrackingTripleIterator(convert(filter(m)));
    }
View Full Code Here

     * Answer an iterator which wraps <code>i</code> to ensure that if a .remove()
     * is executed on it, the graph <code>g</code> will be notified.
    */
    public static ExtendedIterator<Triple> notifyingRemove( final Graph g, Iterator<Triple> i )
        {
        return new TrackingTripleIterator( i )
            {           
            protected final GraphEventManager gem = g.getEventManager();
            @Override
            public void remove()
                {
View Full Code Here

    public void failingTestDoubleRemoveAll() {
        final Graph g = getGraph();
        if (g.getCapabilities().iteratorRemoveAllowed() ) {
            graphAdd(g,"c S d; e:ff GGG hhhh; _i J 27; Ell Em 'en'"  );
            Iterator<Triple> it = new TrackingTripleIterator(g.find(Triple.ANY)){
                @Override
                public void remove() {
                    super.remove(); // removes current
                    g.delete(current); // no-op.
                }
            };
            while (it.hasNext()) {
                it.next();
                it.remove();
            }
            assertTrue( g.isEmpty() );
        }
    }
View Full Code Here

     * Answer an iterator which wraps <code>i</code> to ensure that if a .remove()
     * is executed on it, the graph <code>g</code> will be notified.
    */
    public static ExtendedIterator<Triple> notifyingRemove( final Graph g, Iterator<Triple> i )
        {
        return new TrackingTripleIterator( i )
            {           
            protected final GraphEventManager gem = g.getEventManager();
            @Override
            public void remove()
                {
View Full Code Here

   
    public void failingTestDoubleRemoveAll() {
      final Graph g = getGraph();
      if (g.getCapabilities().iteratorRemoveAllowed() ) {
        graphAdd(g,"c S d; e:ff GGG hhhh; _i J 27; Ell Em 'en'"  );
        Iterator<Triple> it = new TrackingTripleIterator(g.find(Triple.ANY)){
          @Override
          public void remove() {
            super.remove(); // removes current
            g.delete(current); // no-op.
          }
        };
        while (it.hasNext()) {
          it.next();
          it.remove();
        }
        assertTrue( g.isEmpty() );
      }
    }
View Full Code Here

    public void failingTestDoubleRemoveAll() {
        final Graph g = getGraph();
        if (g.getCapabilities().iteratorRemoveAllowed() ) {
            graphAdd(g,"c S d; e:ff GGG hhhh; _i J 27; Ell Em 'en'"  );
            Iterator<Triple> it = new TrackingTripleIterator(g.find(Triple.ANY)){
                @Override
                public void remove() {
                    super.remove(); // removes current
                    g.delete(current); // no-op.
                }
            };
            while (it.hasNext()) {
                it.next();
                it.remove();
            }
            assertTrue( g.isEmpty() );
        }
    }
View Full Code Here

TOP

Related Classes of com.hp.hpl.jena.mem.TrackingTripleIterator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.