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>channelprivate MutexreadMutexThe mutex on which readers must synchronizeprivate java.lang.ObjectwriteMonitor
-
Constructor Summary
Constructors Constructor Description Any2AnyImpl(ChannelInternals<T> _channel)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidendRead()SharedChannelInput<T>in()Returns the input end of the channel.SharedChannelOutput<T>out()Returns the output end of the channel.Tread()booleanreaderDisable()booleanreaderEnable(Alternative alt)booleanreaderPending()voidreaderPoison(int strength)TstartRead()voidwrite(T obj)voidwriterPoison(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:Any2AnyChannelReturns the input end of the channel.- Specified by:
inin interfaceAny2AnyChannel<T>
-
out
public SharedChannelOutput<T> out()
Description copied from interface:Any2AnyChannelReturns the output end of the channel.- Specified by:
outin interfaceAny2AnyChannel<T>
-
endRead
public void endRead()
- Specified by:
endReadin interfaceChannelInternals<T>
-
read
public T read()
- Specified by:
readin interfaceChannelInternals<T>
-
readerDisable
public boolean readerDisable()
- Specified by:
readerDisablein interfaceChannelInternals<T>
-
readerEnable
public boolean readerEnable(Alternative alt)
- Specified by:
readerEnablein interfaceChannelInternals<T>
-
readerPending
public boolean readerPending()
- Specified by:
readerPendingin interfaceChannelInternals<T>
-
readerPoison
public void readerPoison(int strength)
- Specified by:
readerPoisonin interfaceChannelInternals<T>
-
startRead
public T startRead()
- Specified by:
startReadin interfaceChannelInternals<T>
-
write
public void write(T obj)
- Specified by:
writein interfaceChannelInternals<T>
-
writerPoison
public void writerPoison(int strength)
- Specified by:
writerPoisonin interfaceChannelInternals<T>
-
-