Java 8 Stream - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 Stream class.

This code example shows how to use the following methods:iterator
        while(fite.hasNext() && site.hasNext()){
            bc.accept(fite.next(), site.next());
        } 
    } 
    public static <T, U> Stream<Pair<T,U>> zip(Stream<T> f, Stream<U> s){
        Iterator<T> fite = f.iterator();
        Iterator<U> site = s.iterator();
        Iterator<Pair<T, U>> iterator = new Iterator<Pair<T, U>>(){
            @Override 
            public boolean hasNext() { 
                return fite.hasNext() && site.hasNext();
            } 
            @Override 
            public Pair<T, U> next() {
                return Pair.of(fite.next(), site.next());
            } 
        }; 
         
        return StreamSupport.stream(
                Spliterators.spliteratorUnknownSize(
3
CodeRank
This code example shows how to use the following methods:map
     * @param perspectiveAnnotation the perspective annotation 
     * @return  a list of al declared subcomponent instances. 
     */ 
    public List<SubComponent<EventHandler<Event>, Event, Object>> createSubcomponents(final org.jacpfx.api.annotations.perspective.Perspective perspectiveAnnotation) {
        final Stream<? extends Injectable> handlers = getInjectAbles(perspectiveAnnotation);
        return handlers.map(this::mapToSubcomponent).collect(Collectors.toList());
    } 
 
    /** 
     * Returns a single SunComponent by id 
     * @param componentId the component id 
     * @return the component instance 
     */ 
    public SubComponent<EventHandler<Event>, Event, Object> createSubcomponentById(final String componentId) {
        return mapToSubcomponent(mapToInjectAbleComponent(FXUtil.getTargetPerspectiveId(componentId),FXUtil.getTargetComponentId(componentId)));
    } 
 
    /** 
     * Returns a list of all declared Injectables. 
     * @param perspectiveAnnotation the perspective annotation 
3
CodeRank
See Code Examples for Java 8 Stream Methods: