📄 channelofreal.java
字号:
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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -