private K getKey(final S start) { if (null == keyFunction) { return (K) start; } else { return keyFunction.compute(start); } }
public E processNextStart() { return (E) this.function.compute(this.starts); } }
protected K getKey(final S start) { return (null == this.keyFunction) ? (K) start : this.keyFunction.compute(start); }
protected V getValue(final S start) { return (null == this.valueFunction) ? (V) start : this.valueFunction.compute(start); }
public S processNextStart() { while (true) { final S s = this.starts.next(); if (this.filterFunction.compute(s)) return s; } } }
public S processNextStart() { final S s = this.starts.next(); this.sideEffectFunction.compute(s); return s; } }
public E processNextStart() { return this.transformFunction.compute(this.starts.next()); } }
protected S processNextStart() { final S s = this.starts.next(); if (null != this.preStoreFunction) { this.storage.add(this.preStoreFunction.compute(s)); } else { this.storage.add(s); } return s; }
protected S processNextStart() { while (true) { final S s = this.starts.next(); Object t; if (null != this.function) { t = this.function.compute(s); } else { t = s; } if (this.historySet.add(t)) { return s; } } }
private Number getValue(final S start, final K key) { Number number = this.countMap.get(key); if (null == number) { number = 0l; } if (null == valueFunction) { return 1l + number.longValue(); } else { return this.valueFunction.compute(new Pair<S, Number>(start, number)); } } }
@Override public B compute(C argument) { argument = makeFrame(argument); if (delegate == null) { return (B) argument; } return delegate.compute((A) argument); }
protected S processNextStart() { final S s = super.processNextStart(); if (!this.starts.hasNext()) { for (final Map.Entry<K, Collection<V>> entry : this.byMap.entrySet()) { this.reduceMap.put(entry.getKey(), this.reduceFunction.compute(entry.getValue())); } } return s; }
public List processNextStart() { if (this.starts instanceof Pipe) { this.starts.next(); final List path = ((Pipe) this.starts).getCurrentPath(); if (null == this.pathFunctions) { return path; } else { final List closedPath = new ArrayList(); int nextFunction = 0; for (final Object object : path) { closedPath.add(this.pathFunctions[nextFunction].compute(object)); nextFunction = (nextFunction + 1) % this.pathFunctions.length; } return closedPath; } } else { throw new NoSuchElementException("The start of this pipe was not a pipe"); } }
public S processNextStart() { final S s = this.starts.next(); final List row = new ArrayList(); for (final AsPipe asPipe : this.asPipes) { if (doFunctions) { row.add(this.columnFunctions[currentFunction++ % columnFunctions.length].compute(asPipe.getCurrentEnd())); } else { row.add(asPipe.getCurrentEnd()); } } this.table.addRow(row); return s; }
public S processNextStart() { final S s = this.starts.next(); final List path = ((Pipe) this.starts).getCurrentPath(); Tree<Object> depth = this.tree; for (int i = 0; i < path.size(); i++) { Object object = path.get(i); if (null != this.branchFunctions) { object = this.branchFunctions.get(this.currentFunction).compute(object); this.currentFunction = (this.currentFunction + 1) % this.branchFunctions.size(); } if (!depth.containsKey(object)) depth.put(object, new Tree()); depth = depth.get(object); } return s; }
public Table apply(final PipeFunction... functions) { Table table = new Table(); for (final Row row : this) { List temp = new ArrayList(); for (int i = 0; i < row.size(); i++) { temp.add(functions[i % functions.length].compute(row.get(i))); } table.addRow(temp); } return table; }
protected S processNextStart() { if (this.pipeToCap instanceof SideEffectPipe.LazySideEffectPipe) { S next = this.pipeToCap.next(); sideEffectFunction.compute(this.pipeToCap.getSideEffect()); return next; } else { try { return this.pipeToCap.next(); } catch (final NoSuchElementException e) { sideEffectFunction.compute(this.pipeToCap.getSideEffect()); throw FastNoSuchElementException.instance(); } } }
protected S processNextStart() { while (true) { final S s = this.pipe.next(); final LoopBundle<S> loopBundle; if (this.pathEnabled) loopBundle = new LoopBundle<S>(s, this.getCurrentPath(), this.getLoops()); else loopBundle = new LoopBundle<S>(s, null, this.getLoops()); if (whileFunction.compute(loopBundle)) { this.expando.add(loopBundle); if (null != emitFunction && emitFunction.compute(loopBundle)) return s; } else { if (emitFunction == null || emitFunction.compute(loopBundle)) return s; } } }
public Row processNextStart() { this.starts.next(); final Row row; if (null == columnNames) row = new Row(); else row = new Row(columnNames); for (final AsPipe asPipe : this.asPipes) { if (doFunctions) { row.add(this.stepFunctions[currentFunction++ % stepFunctions.length].compute(asPipe.getCurrentEnd())); } else { row.add(asPipe.getCurrentEnd()); } } return row; }
public void execute(final Vertex vertex, final GraphMemory graphMemory) { if (graphMemory.isInitialIteration()) { vertex.setProperty(PAGE_RANK, 1.0d / this.vertexCountAsDouble); double edgeWeightSum = 0.0d; for (final Edge incident : this.outgoingQuery.build(vertex).edges()) { edgeWeightSum = edgeWeightSum + this.edgeWeightFunction.compute(incident); } vertex.setProperty(EDGE_WEIGHT_SUM, edgeWeightSum); } else { double newPageRank = 0.0d; for (final Edge incident : this.incomingQuery.build(vertex).edges()) { final Vertex other = EdgeHelper.getOther(incident, vertex); final Double otherPageRank = other.getProperty(PAGE_RANK); final Double otherEdgeWeightSum = other.getProperty(EDGE_WEIGHT_SUM); newPageRank = newPageRank + (otherPageRank * (this.edgeWeightFunction.compute(incident) / otherEdgeWeightSum)); } vertex.setProperty(PAGE_RANK, (this.alpha * newPageRank) + ((1.0d - this.alpha) / this.vertexCountAsDouble)); } }