Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 7 of 7 for FromIterator (0.11 sec)

  1. test/typeparam/issue48598.go

    package main
    
    type Iterator[T any] interface {
    	Iterate()
    }
    
    type IteratorFunc[T any] func(fn func(T) bool)
    
    func (f IteratorFunc[T]) Iterate() {
    }
    
    func FromIterator[T any](it Iterator[T]) {
    	it.Iterate()
    }
    
    func Foo[T, R any]() {
    	FromIterator[R](IteratorFunc[R](nil))
    }
    
    func main() {
    	Foo[int, int]()
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Mar 01 19:45:34 UTC 2022
    - 475 bytes
    - Viewed (0)
  2. test/typeparam/issue48645b.go

    	f(fn)
    }
    
    type Stream[T any] struct {
    	it Iterator[T]
    }
    
    func (s Stream[T]) Iterate(fn func(T) bool) {
    	if s.it == nil {
    		return
    	}
    	s.it.Iterate(fn)
    }
    
    func FromIterator[T any](it Iterator[T]) Stream[T] {
    	return Stream[T]{it: it}
    }
    
    func (s Stream[T]) DropWhile(fn func(T) bool) Stream[T] {
    	return Pipe[T, T](s, func(t T) (T, bool) {
    		return t, true
    	})
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Mar 01 19:45:34 UTC 2022
    - 1.4K bytes
    - Viewed (0)
  3. guava/src/com/google/common/collect/Streams.java

                    long index = 0;
    
                    @Override
                    public boolean tryAdvance(Consumer<? super R> action) {
                      if (fromIterator.hasNext()) {
                        action.accept(function.apply(fromIterator.next(), index++));
                        return true;
                      }
                      return false;
                    }
                  },
                  isParallel)
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Thu Feb 22 21:19:52 UTC 2024
    - 36.5K bytes
    - Viewed (0)
  4. guava/src/com/google/common/base/Converter.java

            return new Iterator<B>() {
              private final Iterator<? extends A> fromIterator = fromIterable.iterator();
    
              @Override
              public boolean hasNext() {
                return fromIterator.hasNext();
              }
    
              @Override
              public B next() {
                return convert(fromIterator.next());
              }
    
              @Override
              public void remove() {
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Thu Feb 15 16:12:13 UTC 2024
    - 23K bytes
    - Viewed (0)
  5. android/guava/src/com/google/common/base/Converter.java

            return new Iterator<B>() {
              private final Iterator<? extends A> fromIterator = fromIterable.iterator();
    
              @Override
              public boolean hasNext() {
                return fromIterator.hasNext();
              }
    
              @Override
              public B next() {
                return convert(fromIterator.next());
              }
    
              @Override
              public void remove() {
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Thu Feb 15 16:12:13 UTC 2024
    - 23K bytes
    - Viewed (0)
  6. android/guava/src/com/google/common/collect/Iterators.java

       * fromIterator}.
       *
       * <p>The returned iterator supports {@code remove()} if {@code fromIterator} does. After a
       * successful {@code remove()} call, {@code fromIterator} no longer contains the corresponding
       * element.
       */
      public static <F extends @Nullable Object, T extends @Nullable Object> Iterator<T> transform(
          Iterator<F> fromIterator, Function<? super F, ? extends T> function) {
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Fri May 03 14:46:32 UTC 2024
    - 50.2K bytes
    - Viewed (0)
  7. guava/src/com/google/common/collect/Iterators.java

       * fromIterator}.
       *
       * <p>The returned iterator supports {@code remove()} if {@code fromIterator} does. After a
       * successful {@code remove()} call, {@code fromIterator} no longer contains the corresponding
       * element.
       */
      public static <F extends @Nullable Object, T extends @Nullable Object> Iterator<T> transform(
          Iterator<F> fromIterator, Function<? super F, ? extends T> function) {
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Fri May 03 14:46:32 UTC 2024
    - 50.2K bytes
    - Viewed (0)
Back to top