Package org.jcsp.lang
Class Any2AnyImpl<T>
- java.lang.Object
-
- org.jcsp.lang.Any2AnyImpl<T>
-
- All Implemented Interfaces:
Any2AnyChannel<T>
,ChannelInternals<T>
- Direct Known Subclasses:
Any2AnyChannelImpl
,BufferedAny2AnyChannel
,PoisonableAny2AnyChannelImpl
,PoisonableBufferedAny2AnyChannel
class Any2AnyImpl<T> extends java.lang.Object implements Any2AnyChannel<T>, ChannelInternals<T>
-
-
Field Summary
Fields Modifier and Type Field Description private ChannelInternals<T>
channel
private Mutex
readMutex
The mutex on which readers must synchronizeprivate java.lang.Object
writeMonitor
-
Constructor Summary
Constructors Constructor Description Any2AnyImpl(ChannelInternals<T> _channel)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
endRead()
SharedChannelInput<T>
in()
Returns the input end of the channel.SharedChannelOutput<T>
out()
Returns the output end of the channel.T
read()
boolean
readerDisable()
boolean
readerEnable(Alternative alt)
boolean
readerPending()
void
readerPoison(int strength)
T
startRead()
void
write(T obj)
void
writerPoison(int strength)
-
-
-
Field Detail
-
channel
private ChannelInternals<T> channel
-
readMutex
private final Mutex readMutex
The mutex on which readers must synchronize
-
writeMonitor
private final java.lang.Object writeMonitor
-
-
Constructor Detail
-
Any2AnyImpl
Any2AnyImpl(ChannelInternals<T> _channel)
-
-
Method Detail
-
in
public SharedChannelInput<T> in()
Description copied from interface:Any2AnyChannel
Returns the input end of the channel.- Specified by:
in
in interfaceAny2AnyChannel<T>
-
out
public SharedChannelOutput<T> out()
Description copied from interface:Any2AnyChannel
Returns the output end of the channel.- Specified by:
out
in interfaceAny2AnyChannel<T>
-
endRead
public void endRead()
- Specified by:
endRead
in interfaceChannelInternals<T>
-
read
public T read()
- Specified by:
read
in interfaceChannelInternals<T>
-
readerDisable
public boolean readerDisable()
- Specified by:
readerDisable
in interfaceChannelInternals<T>
-
readerEnable
public boolean readerEnable(Alternative alt)
- Specified by:
readerEnable
in interfaceChannelInternals<T>
-
readerPending
public boolean readerPending()
- Specified by:
readerPending
in interfaceChannelInternals<T>
-
readerPoison
public void readerPoison(int strength)
- Specified by:
readerPoison
in interfaceChannelInternals<T>
-
startRead
public T startRead()
- Specified by:
startRead
in interfaceChannelInternals<T>
-
write
public void write(T obj)
- Specified by:
write
in interfaceChannelInternals<T>
-
writerPoison
public void writerPoison(int strength)
- Specified by:
writerPoison
in interfaceChannelInternals<T>
-
-