/** * <p> * Close the graph by closing all of the sub-graphs. * </p> * * @see org.apache.jena.graph.Graph#close() */ @Override public void close() { for ( Graph m_subGraph : m_subGraphs ) { m_subGraph.close(); } super.close(); }
/** * <p> * Answer an iterator over the elements of iterator a that are not members of iterator b. * As a side-effect, iterator b will be closed. * </p> * * @param a An iterator that will be filtered by rejecting the elements of b * @param b A closable iterator * @return The iteration of elements in a but not in b. */ public static <T> ClosableIterator<T> butNot( final ClosableIterator<T> a, final ClosableIterator<? extends T> b ) { return new FilterIterator<>( reject( b ), a ); }
@Override public TransactionHandler getTransactionHandler() { return (getBaseGraph() == null) ? super.getTransactionHandler() : getBaseGraph().getTransactionHandler(); }
@Override public Capabilities getCapabilities() { return (getBaseGraph() == null) ? super.getCapabilities() : getBaseGraph().getCapabilities(); }
/** * Test the things() iterator generating utility function. */ public void testThings() { ExtendedIterator<String> it1 = things( "now is the time" ); ExtendedIterator<String> it2 = things( "now is the time" ); ExtendedIterator<String> mt1 = things( "" ); ExtendedIterator<String> mt2 = things( "" ); assertEquals( "mt1.hasNext()", false, mt1.hasNext() ); assertEquals( "mt2.hasNext()", false, mt2.hasNext() ); assertEquals( "andThen(mt1,mt2).hasNext()", false, mt1.andThen( mt2 ).hasNext() ); assertEquals( "butNot(it1,it2).hasNext()", false, CompositionBase.butNot( it1, it2 ).hasNext() ); assertEquals( "x y z @butNot z", true, CompositionBase.butNot( things( "x y z" ), things( "z" ) ).hasNext() ); assertEquals( "x y z @butNot a", true, CompositionBase.butNot( things( "x y z" ), things( "z" ) ).hasNext() ); }
@Override public TransactionHandler getTransactionHandler() { return (getBaseGraph() == null) ? super.getTransactionHandler() : getBaseGraph().getTransactionHandler(); }
@Override public Capabilities getCapabilities() { return (getBaseGraph() == null) ? super.getCapabilities() : getBaseGraph().getCapabilities(); }
/** * Test the things() iterator generating utility function. */ public void testThings() { ExtendedIterator<String> it1 = things( "now is the time" ); ExtendedIterator<String> it2 = things( "now is the time" ); ExtendedIterator<String> mt1 = things( "" ); ExtendedIterator<String> mt2 = things( "" ); assertEquals( "mt1.hasNext()", false, mt1.hasNext() ); assertEquals( "mt2.hasNext()", false, mt2.hasNext() ); assertEquals( "andThen(mt1,mt2).hasNext()", false, mt1.andThen( mt2 ).hasNext() ); assertEquals( "butNot(it1,it2).hasNext()", false, CompositionBase.butNot( it1, it2 ).hasNext() ); assertEquals( "x y z @butNot z", true, CompositionBase.butNot( things( "x y z" ), things( "z" ) ).hasNext() ); assertEquals( "x y z @butNot a", true, CompositionBase.butNot( things( "x y z" ), things( "z" ) ).hasNext() ); }
/** * <p> * Close the graph by closing all of the sub-graphs. * </p> * * @see org.apache.jena.graph.Graph#close() */ @Override public void close() { for ( Graph m_subGraph : m_subGraphs ) { m_subGraph.close(); } super.close(); }
/** * <p> * Answer an iterator over the elements of iterator a that are not members of iterator b. * As a side-effect, iterator b will be closed. * </p> * * @param a An iterator that will be filtered by rejecting the elements of b * @param b A closable iterator * @return The iteration of elements in a but not in b. */ public static <T> ClosableIterator<T> butNot( final ClosableIterator<T> a, final ClosableIterator<? extends T> b ) { return new FilterIterator<>( reject( b ), a ); }
@Override public void close() { super.close() ; base.close() ; additions.close() ; deletions.close() ; }
@Override public void close() { super.close() ; base.close() ; additions.close() ; deletions.close() ; }