public List getCurrentPath() { if (this.pathEnabled) { final List pathElements = getPathToHere(); if (this instanceof TransformPipe) { pathElements.add(this.currentEnd); } else if (!(this instanceof SideEffectPipe) && !(this instanceof FilterPipe)) { final int size = pathElements.size(); if (size == 0 || pathElements.get(size - 1) != this.currentEnd) { // do not repeat filters or side-effects as they dup the object // this is for backwards compatibility to before TransformPipe interface pathElements.add(this.currentEnd); } } return pathElements; } else { throw new RuntimeException(Pipe.NO_PATH_MESSAGE); } }
protected List<S> gather() { final List<S> list = new ArrayList<S>(); this.listPaths = new ArrayList<List>(); if (!this.starts.hasNext()) { throw FastNoSuchElementException.instance(); } else { while (this.starts.hasNext()) { final S s = this.starts.next(); list.add(s); if (this.pathEnabled) this.listPaths.add(super.getPathToHere()); } } if (this.pathEnabled) { return addList(list); } else { return list; } }
protected List<S> processNextStart() { final List<S> list = new ArrayList<S>(); this.listPaths = new ArrayList<List>(); if (!this.starts.hasNext()) { throw FastNoSuchElementException.instance(); } else { while (this.starts.hasNext()) { final S s = this.starts.next(); list.add(s); if (this.pathEnabled) this.listPaths.add(super.getPathToHere()); } } if (this.pathEnabled) { return addList(list); } else { return list; } }
protected E processNextStart() { final List<S> list = new ArrayList<S>(); this.listPaths = new ArrayList<List>(); if (!this.starts.hasNext()) { throw FastNoSuchElementException.instance(); } else { while (this.starts.hasNext()) { final S s = this.starts.next(); list.add(s); if (this.pathEnabled) this.listPaths.add(super.getPathToHere()); } } if (this.pathEnabled) { E e = this.postFilterFunction.compute(list); if (e instanceof List) addList((List) e); else addList(Arrays.asList(e)); return e; //return (E) addList((List) this.postFilterFunction.compute(list)); } else { return this.postFilterFunction.compute(list); } }