/** Answer a list containing the elements from the iterator <code>it</code>, in order; a shorthand for <code>IteratorCollection.iteratorToList(it)</code>, which see. */ public static <T> List<T> iteratorToList( Iterator<? extends T> it ) { return IteratorCollection.iteratorToList( it ); }
/** * <p> * Answer a {@link Predicate} that will accept any object that is an element of * iterator i. As a side-effect, i will be evaluated and closed. * </p> * * @param i A closable iterator * @return A Predicate that will accept any object in iterator i. */ public static <T> Predicate<T> ifIn( final ClosableIterator<T> i ) { final Set<T> allow = IteratorCollection.iteratorToSet( i ); return allow::contains; }
/** * Answer a list containing the elements from the iterator <code>it</code>, * in order; a shorthand for * <code>IteratorCollection.iteratorToList(it)</code>, which see. */ public static <T> List<T> iteratorToList(Iterator<? extends T> it) { return IteratorCollection.iteratorToList(it); }
/** * <p> * Answer a {@link Predicate} that will accept any object that is an element of * iterator i. As a side-effect, i will be evaluated and closed. * </p> * * @param i A closable iterator * @return A Predicate that will accept any object in iterator i. */ public static <T> Predicate<T> ifIn( final ClosableIterator<T> i ) { final Set<T> allow = IteratorCollection.iteratorToSet( i ); return allow::contains; }
/** Answer a list containing the elements from the iterator <code>it</code>, in order; a shorthand for <code>IteratorCollection.iteratorToList(it)</code>, which see. */ public static <T> List<T> iteratorToList( Iterator<? extends T> it ) { return IteratorCollection.iteratorToList( it ); }
/** * <p> * Answer a {@link Predicate} that will reject any element that is a member of iterator i. * As a side-effect, i will be closed. * </p> * * @param i A closable iterator * @return A Predicate that will accept any object not a member of i. */ public static <T> Predicate<T> reject( final ClosableIterator<? extends T> i ) { final Set< ? extends T> suppress = IteratorCollection.iteratorToSet( i ); return o -> !suppress.contains( o ); }
/** * Delete the triples supplied by an iterator. This function is "concurrent * modification" safe - it internally takes a copy of the iterator. */ private static void deleteIteratorWorker(Graph graph, Iterator<Triple> it) { List<Triple> s = IteratorCollection.iteratorToList(it) ; deleteIteratorWorkerDirect(graph, s.iterator()); }
/** * <p> * Answer a {@link Predicate} that will reject any element that is a member of iterator i. * As a side-effect, i will be closed. * </p> * * @param i A closable iterator * @return A Predicate that will accept any object not a member of i. */ public static <T> Predicate<T> reject( final ClosableIterator<? extends T> i ) { final Set< ? extends T> suppress = IteratorCollection.iteratorToSet( i ); return o -> !suppress.contains( o ); }
/** * Delete the triples supplied by an iterator. This function is "concurrent * modification" safe - it internally takes a copy of the iterator. */ private static void deleteIteratorWorker(Graph graph, Iterator<Triple> it) { List<Triple> s = IteratorCollection.iteratorToList(it) ; deleteIteratorWorkerDirect(graph, s.iterator()); }
/** Answer a set containing the elements from the iterator <code>it</code>; a shorthand for <code>IteratorCollection.iteratorToSet(it)</code>, which see. */ public static <T> Set<T> iteratorToSet( Iterator<? extends T> it ) { return IteratorCollection.iteratorToSet( it ); }
/** * Answer a list containing the elements from the iterator <code>it</code>, * in order; a shorthand for * <code>IteratorCollection.iteratorToList(it)</code>, which see. */ public static <T> List<T> iteratorToList(Iterator<? extends T> it) { return IteratorCollection.iteratorToList(it); }
/** * Answer a set containing the elements from the iterator <code>it</code>; a * shorthand for <code>IteratorCollection.iteratorToSet(it)</code>, which * see. */ public static <T> Set<T> iteratorToSet(Iterator<? extends T> it) { return IteratorCollection.iteratorToSet(it); }
@Override public void notifyDeleteIterator(Graph g, Iterator<Triple> it) { notifyDeleteIterator(g, IteratorCollection.iteratorToList(it)) ; }
/** Answer a set containing the elements from the iterator <code>it</code>; a shorthand for <code>IteratorCollection.iteratorToSet(it)</code>, which see. */ public static <T> Set<T> iteratorToSet( Iterator<? extends T> it ) { return IteratorCollection.iteratorToSet( it ); }
@Override public void notifyDeleteIterator(Graph g, Iterator<Triple> it) { notifyDeleteIterator(g, IteratorCollection.iteratorToList(it)) ; }
/** * Answer a set containing the elements from the iterator <code>it</code>; a * shorthand for <code>IteratorCollection.iteratorToSet(it)</code>, which * see. */ public static <T> Set<T> iteratorToSet(Iterator<? extends T> it) { return IteratorCollection.iteratorToSet(it); }
private static void addIteratorWorker( Graph graph, Iterator<Triple> it ) { List<Triple> s = IteratorCollection.iteratorToList( it ); addIteratorWorkerDirect(graph, s.iterator()); }
public void testLotsToSet() { Object [] elements = new Object[] {"now", "is", "the", "time"}; Iterator<Object> it = Arrays.asList( elements ).iterator(); assertEquals( setLots( elements ), IteratorCollection.iteratorToSet( it ) ); }
@Override public void notifyAddIterator(Graph g, Iterator<Triple> it) { notifyAddIterator(g, IteratorCollection.iteratorToList(it)) ; }
public void testLotsToSet() { Object [] elements = new Object[] {"now", "is", "the", "time"}; Iterator<Object> it = Arrays.asList( elements ).iterator(); assertEquals( setLots( elements ), IteratorCollection.iteratorToSet( it ) ); }