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 Object> |
getSourcePort() |
InputPort<Object> |
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 static final IPipe<?> INSTANCE
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<Object>
element
- Element which will be addedtrue
if the element could be added, false otherwisepublic Object removeLast()
IPipe
removeLast
in interface IPipe<Object>
null
if the pipe is currently empty.public boolean isEmpty()
IPipe
public int size()
public OutputPort<? extends Object> getSourcePort()
getSourcePort
in interface IPipe<Object>
public InputPort<Object> getTargetPort()
getTargetPort
in interface IPipe<Object>
public void sendSignal(ISignal signal)
IPipe
sendSignal
in interface IPipe<Object>
signal
- The signal which needs to be passed on.public void reportNewElement()
IPipe
reportNewElement
in interface IPipe<Object>
public boolean isClosed()
public boolean hasMore()
public void waitForStartSignal() throws InterruptedException
waitForStartSignal
in interface IPipe<Object>
InterruptedException
public void close()
IPipe
public int capacity()
public void setScheduler(PipeScheduler scheduler)
setScheduler
in interface IPipe<Object>
Copyright © 2015–2020. All rights reserved.