public class Pipeline<S,E> extends Object implements Pipe<S,E>, MetaPipe
| Modifier and Type | Field and Description |
|---|---|
protected Pipe<?,E> |
endPipe |
protected boolean |
pathEnabled |
protected List<Pipe> |
pipes |
protected Pipe<S,?> |
startPipe |
protected Iterator<S> |
starts |
NO_PATH_MESSAGE| Constructor and Description |
|---|
Pipeline() |
Pipeline(List<Pipe> pipes)
Constructs a pipeline from the provided pipes.
|
Pipeline(Pipe... pipes)
Constructs a pipeline from the provided pipes.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addPipe(int location,
Pipe pipe) |
void |
addPipe(Pipe pipe)
Adds a new pipe to the end of the pipeline and then reconstructs the pipeline chain.
|
<E> Pipeline<S,E> |
cast(Class<E> end)
Returns the current pipeline with a new end type.
|
long |
count() |
void |
enablePath(boolean enable)
Calculating paths can be an expensive operation for some pipes.
|
boolean |
equals(Object object) |
Collection<E> |
fill(Collection<E> collection) |
Pipe |
get(int index) |
List |
getCurrentPath()
Returns the transformation path to arrive at the current object of the pipe.
|
List<Pipe> |
getPipes() |
Iterator<S> |
getStarts() |
boolean |
hasNext()
Determines if there is another object that can be emitted from the pipeline.
|
void |
iterate() |
Iterator<E> |
iterator()
Simply returns this as as a pipeline (more specifically, pipe) implements Iterator.
|
E |
next()
Get the next object emitted from the pipeline.
|
List<E> |
next(int number) |
void |
remove()
An unsupported operation that throws an UnsupportedOperationException.
|
Pipe |
remove(int index) |
void |
reset()
A pipe may maintain state.
|
protected void |
setPipes(List<Pipe> pipes)
Useful for constructing the pipeline chain without making use of the constructor.
|
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.
|
int |
size()
Get the number of pipes in the pipeline.
|
List<E> |
toList() |
String |
toString() |
public Pipeline()
public Pipeline(List<Pipe> pipes)
pipes - the ordered list of pipes to chain together into a pipelinepublic Pipeline(Pipe... pipes)
pipes - the ordered array of pipes to chain together into a pipelineprotected void setPipes(List<Pipe> pipes)
pipes - the ordered list of pipes to chain together into a pipelinepublic void addPipe(Pipe pipe)
pipe - the new pipe to add to the pipelinepublic void addPipe(int location,
Pipe pipe)
public void setStarts(Iterator<S> starts)
Pipepublic void setStarts(Iterable<S> starts)
Pipepublic void remove()
public boolean hasNext()
public E next()
public List getCurrentPath()
PipegetCurrentPath in interface Pipe<S,E>public void enablePath(boolean enable)
PipeenablePath in interface Pipe<S,E>enable - enable path calculationspublic int size()
public void reset()
Pipepublic Iterator<E> iterator()
public <E> Pipeline<S,E> cast(Class<E> end)
public Pipe remove(int index)
public Pipe get(int index)
public long count()
public void iterate()
public Collection<E> fill(Collection<E> collection)
Copyright © 2010-2014. All Rights Reserved.