org.codehaus.gpars

groovyx.gpars.dataflow.stream
[Java] Class DataflowStreamWriteAdapter

java.lang.Object
  groovyx.gpars.dataflow.stream.DataflowStreamWriteAdapter
All Implemented Interfaces:
DataflowWriteChannel

@SuppressWarnings({"SynchronizedMethod"})
public class DataflowStreamWriteAdapter

Adapts a DataflowStream to accommodate for the DataflowWriteChannel interface. It also synchronizes all changes to the underlying stream allowing multiple threads accessing the stream concurrently.

Parameters:
- The type of messages to pass through the stream
Authors:
Vaclav Pech


Field Summary
private StreamCore head

 
Constructor Summary
DataflowStreamWriteAdapter(StreamCore stream)

Creates a new adapter

 
Method Summary
void bind(java.lang.Object value)

protected StreamCore getHead()

DataflowWriteChannel leftShift(java.lang.Object value)

DataflowWriteChannel leftShift(DataflowReadChannel ref)

java.lang.String toString()

private StreamCore updateHead()

Moves head

 
Methods inherited from class java.lang.Object
java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#wait(long, int), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()
 

Field Detail

head

private StreamCore head


 
Constructor Detail

DataflowStreamWriteAdapter

public DataflowStreamWriteAdapter(StreamCore stream)
Creates a new adapter
Parameters:
stream - The stream to wrap


 
Method Detail

bind

@Override
public final void bind(java.lang.Object value)


getHead

protected final StreamCore getHead()


leftShift

@Override
public final DataflowWriteChannel leftShift(java.lang.Object value)


leftShift

@Override
public final DataflowWriteChannel leftShift(DataflowReadChannel ref)


toString

@Override
public java.lang.String toString()


updateHead

private StreamCore updateHead()
Moves head
Returns:
The old head


 

Copyright © 2008–2012 Václav Pech. All Rights Reserved.