org.codehaus.gpars

groovyx.gpars.dataflow.stream
Class DataFlowStreamWriteAdapter

java.lang.Object
  groovyx.gpars.dataflow.stream.DataFlowStreamWriteAdapter
All Implemented Interfaces:
DataFlowWriteChannel

@SuppressWarnings({"SynchronizedMethod"})
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 DataFlowStream head

 
Constructor Summary
DataFlowStreamWriteAdapter(DataFlowStream stream)

Creates a new adapter

 
Method Summary
void bind(T value)

protected DataFlowStream getHead()

DataFlowWriteChannel leftShift(T value)

DataFlowWriteChannel leftShift(DataFlowReadChannel ref)

java.lang.String toString()

 
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 DataFlowStream head


 
Constructor Detail

DataFlowStreamWriteAdapter

public DataFlowStreamWriteAdapter(DataFlowStream stream)
Creates a new adapter
Parameters:
stream - The stream to wrap


 
Method Detail

bind

@Override
public final void bind(T value)


getHead

protected final DataFlowStream getHead()


leftShift

@Override
public final DataFlowWriteChannel leftShift(T value)


leftShift

@Override
public final DataFlowWriteChannel leftShift(DataFlowReadChannel ref)


toString

@Override
public java.lang.String toString()


 

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