public abstract class AbstractPipe<S,E> extends Object implements Pipe<S,E>
protected E processNextStart() throws NoSuchElementException {
S s = this.starts.next();
E e = // do something with the S to yield an E
return e;
}
If the current incoming S is not to be emitted and there are no other S objects to process and emit, then throw a NoSuchElementException.| Modifier and Type | Field and Description |
|---|---|
protected E |
currentEnd |
protected boolean |
pathEnabled |
protected Iterator<S> |
starts |
NO_PATH_MESSAGE| Constructor and Description |
|---|
AbstractPipe() |
| Modifier and Type | Method and Description |
|---|---|
void |
enablePath(boolean enable)
Calculating paths can be an expensive operation for some pipes.
|
List |
getCurrentPath()
Returns the transformation path to arrive at the current object of the pipe.
|
protected List |
getPathToHere() |
boolean |
hasNext() |
Iterator<E> |
iterator()
The iterator method of Iterable is not faithful to the Java semantics of iterator().
|
E |
next() |
protected abstract E |
processNextStart() |
void |
remove() |
void |
reset()
A pipe may maintain state.
|
void |
setStarts(Iterable<S> starts)
Set an iterable of S objects to the head (start) of the pipe.
|
void |
setStarts(Iterator<S> starts)
Set an iterator of S objects to the head (start) of the pipe.
|
void |
setStarts(Pipe<?,S> starts) |
String |
toString() |
protected E currentEnd
protected boolean pathEnabled
public void setStarts(Iterator<S> starts)
Pipepublic void setStarts(Iterable<S> starts)
Pipepublic void reset()
Pipepublic List getCurrentPath()
PipegetCurrentPath in interface Pipe<S,E>public void enablePath(boolean enable)
PipeenablePath in interface Pipe<S,E>enable - enable path calculationspublic Iterator<E> iterator()
protected abstract E processNextStart() throws NoSuchElementException
NoSuchElementExceptionprotected List getPathToHere()
Copyright © 2010-2014. All Rights Reserved.