channelofreal.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 ChannelOfReal extends One2OneChannel {
  /**
   * writes a string value to the channel;
   */
   public void send(float value) {
     write(new Float(value)); // write the value as an float object
   }

  /**
   * returns the float written to the channel
   */
  public float receive() {
    return ((Float) read()).floatValue(); // return the float value
  }
}

⌨️ 快捷键说明

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