Constructor and Description |
---|
InstantiationPipe(OutputPort<? extends T> sourcePort,
InputPort<T> targetPort,
int capacity) |
Modifier and Type | Method and Description |
---|---|
void |
add(Object element)
Adds an element to the pipe.
|
boolean |
addNonBlocking(Object element)
Adds an element to the pipe.
|
int |
capacity() |
void |
close()
May only be invoked by the input port and the owning (target) stage.
|
OutputPort<? extends T> |
getSourcePort() |
InputPort<T> |
getTargetPort() |
boolean |
hasMore() |
boolean |
isClosed() |
boolean |
isEmpty()
Checks whether the pipe is empty or not.
|
Object |
removeLast()
Retrieves and removes the last element from the pipe.
|
void |
reportNewElement()
Stages report new elements with this method.
|
void |
sendSignal(ISignal signal)
A stage can pass on a signal by executing this method.
|
void |
setScheduler(PipeScheduler scheduler) |
int |
size() |
void |
waitForStartSignal() |
public InstantiationPipe(OutputPort<? extends T> sourcePort, InputPort<T> targetPort, int capacity)
public int capacity()
public OutputPort<? extends T> getSourcePort()
getSourcePort
in interface IPipe<T>
public InputPort<T> getTargetPort()
getTargetPort
in interface IPipe<T>
public void add(Object element)
IPipe
IPipe.addNonBlocking(Object)
).
If it cannot guarantee element delivery in some special situation, it then must throw an exception.public boolean addNonBlocking(Object element)
IPipe
addNonBlocking
in interface IPipe<T>
element
- Element which will be addedtrue
if the element could be added, false otherwisepublic boolean isEmpty()
IPipe
public int size()
public Object removeLast()
IPipe
removeLast
in interface IPipe<T>
null
if the pipe is currently empty.public void sendSignal(ISignal signal)
IPipe
sendSignal
in interface IPipe<T>
signal
- The signal which needs to be passed on.public void reportNewElement()
IPipe
reportNewElement
in interface IPipe<T>
public boolean isClosed()
public boolean hasMore()
public void waitForStartSignal() throws InterruptedException
waitForStartSignal
in interface IPipe<T>
InterruptedException
public void close()
IPipe
public void setScheduler(PipeScheduler scheduler)
setScheduler
in interface IPipe<T>
Copyright © 2015–2020. All rights reserved.