Package org.jcsp.lang
Class ChannelOutputImpl<T>
- java.lang.Object
-
- org.jcsp.lang.ChannelOutputImpl<T>
-
- All Implemented Interfaces:
ChannelOutput<T>,Poisonable
- Direct Known Subclasses:
RejectableChannelOutputImpl
class ChannelOutputImpl<T> extends java.lang.Object implements ChannelOutput<T>
-
-
Field Summary
Fields Modifier and Type Field Description private ChannelInternals<T>channelprivate intimmunity
-
Constructor Summary
Constructors Constructor Description ChannelOutputImpl(ChannelInternals _channel, int _immunity)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidpoison(int strength)This injects poison into the channel.voidwrite(T object)Write an Object to the channel.
-
-
-
Field Detail
-
channel
private ChannelInternals<T> channel
-
immunity
private int immunity
-
-
Constructor Detail
-
ChannelOutputImpl
ChannelOutputImpl(ChannelInternals _channel, int _immunity)
-
-
Method Detail
-
write
public void write(T object)
Description copied from interface:ChannelOutputWrite an Object to the channel.- Specified by:
writein interfaceChannelOutput<T>- Parameters:
object- the object to write to the channel
-
poison
public void poison(int strength)
Description copied from interface:PoisonableThis injects poison into the channel. If the channel was not explicitly constructed to be poisonable or if the strength of poison is not greater than the channel immunity level, the poison will have no effect.- Specified by:
poisonin interfacePoisonable- Parameters:
strength- the strength of the poison (must be >= 0).
-
-