CSP for Java
(JCSP) 1.1-rc4

org.jcsp.lang
Class AltingChannelInputWrapper

java.lang.Object
  extended by org.jcsp.lang.Guard
      extended by org.jcsp.lang.AltingChannelInput
          extended by org.jcsp.lang.AltingChannelInputWrapper
All Implemented Interfaces:
ChannelInput, Poisonable
Direct Known Subclasses:
FilteredAltingChannelInput, NetAltingChannelInput

Deprecated. There is no longer any need to use this class, after the 1.1 class reorganisation. Note that usually you do not need the absolute guarantee that this class provides - you can usually just cast the channel to an AltingChannelInput, which prevents you from accidentally writing to the channel. This class mainly exists for use by some of the org.jcsp.net classes, where the absolute guarantee that you cannot write to it is important.

public class AltingChannelInputWrapper
extends AltingChannelInput

This class wraps an ALTable channel so that only the reading part is available to the caller. Writes are impossible unless you subclass this (and use getChannel()) or keep a reference to the original channel.

Author:
Quickstone Technologies Limited
See Also:
AltingChannelInput

Constructor Summary
protected AltingChannelInputWrapper()
          Deprecated. This constructor does not wrap a channel.
  AltingChannelInputWrapper(AltingChannelInput channel)
          Deprecated. Creates a new AltingChannelInputWrapper which wraps the specified channel.
 
Method Summary
 void endRead()
          Deprecated. Ends an extended rendezvous
protected  AltingChannelInput getChannel()
          Deprecated. Get the real channel.
 boolean pending()
          Deprecated. Returns whether there is data pending on this channel.
 void poison(int strength)
          Deprecated. This injects poison into the channel.
 Object read()
          Deprecated. Read an Object from the channel.
protected  void setChannel(AltingChannelInput chan)
          Deprecated. Sets the real channel to be used.
 Object startRead()
          Deprecated. Begins an extended rendezvous
 
Methods inherited from class org.jcsp.lang.Guard
schedule
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AltingChannelInputWrapper

public AltingChannelInputWrapper(AltingChannelInput channel)
Deprecated. 
Creates a new AltingChannelInputWrapper which wraps the specified channel.


AltingChannelInputWrapper

protected AltingChannelInputWrapper()
Deprecated. 
This constructor does not wrap a channel. The underlying channel can be set by calling setChannel(AltingChannelInput).

Method Detail

getChannel

protected AltingChannelInput getChannel()
Deprecated. 
Get the real channel.

Returns:
The real channel.

setChannel

protected void setChannel(AltingChannelInput chan)
Deprecated. 
Sets the real channel to be used.

Parameters:
chan - the real channel to be used.

read

public Object read()
Deprecated. 
Read an Object from the channel.

Returns:
the object read from the channel

startRead

public Object startRead()
Deprecated. 
Begins an extended rendezvous

Returns:
The object read from the channel
See Also:
ChannelInput.startRead

endRead

public void endRead()
Deprecated. 
Ends an extended rendezvous

See Also:
ChannelInput.endRead

pending

public boolean pending()
Deprecated. 
Returns whether there is data pending on this channel.

Note: if there is, it won't go away until you read it. But if there isn't, there may be some by the time you check the result of this method.

Specified by:
pending in class AltingChannelInput
Returns:
state of the channel.

poison

public void poison(int strength)
Deprecated. 
Description copied from interface: Poisonable
This 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.

Parameters:
strength - the strength of the poison (must be >= 0).

CSP for Java
(JCSP) 1.1-rc4

Submit a bug or feature to jcsp-team@kent.ac.uk
Version 1.1-rc4 of the JCSP API Specification (Copyright 1997-2008 P.D.Austin and P.H.Welch - All Rights Reserved)
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.