channelofstring.java

来自「java实现的一个pascal编译器」· Java 代码 · 共 25 行

JAVA
25
字号
package uk.co.brainycreatures.jpascal.type;
import jcsp.lang.*;

/**
 * represents a channel that writes and reads
 * Strings to and from a channel
 * @author Fidel Viegas (viegasfh@hotmail.com)
 */
public class ChannelOfString extends One2OneChannel {
  /**
   * writes a string value to the channel;
   */
   public void send(String value) {
     write(value); // write the value as an string object
   }

  /**
   * returns the string written to the channel
   */
  public String receive() {
    return (String) read(); // return the string value
  }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?