public abstract class Stream
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
abstract Function<java.lang.Void,? extends Stream> |
getStreamProvider() |
UQI |
getUQI() |
boolean |
isClosed()
Check whether the stream is closed,
Stream generator functions should make sure the stream is not closed this writing items to it.
|
void |
register(Function<? extends Stream,?> streamReceiver)
Register a function to current stream.
|
Stream |
reuse(int numOfReuses) |
java.util.Map<java.lang.String,java.lang.Object> |
toMap() |
java.lang.String |
toString() |
void |
unregister(Function<? extends Stream,?> streamReceiver)
Unregister a function from current stream.
|
void |
write(Item item,
Function<?,? extends Stream> streamProvider)
Write an item to the stream,
or write a null to end the stream.
|
public void write(Item item, Function<?,? extends Stream> streamProvider)
item
- the item to write to the stream, null indicates the end of the streamstreamProvider
- the function that provide current streampublic void register(Function<? extends Stream,?> streamReceiver)
streamReceiver
- the function that receives stream itemspublic void unregister(Function<? extends Stream,?> streamReceiver)
streamReceiver
- the function that receives stream itemspublic boolean isClosed()
public java.util.Map<java.lang.String,java.lang.Object> toMap()
public java.lang.String toString()
toString
in class java.lang.Object
public UQI getUQI()
public Stream reuse(int numOfReuses)