Mercurial > hg > FederatedLinda
view src/fdl/PSXReply.java @ 71:0352536c33fa
(example: writer) get linda server addr from commandline arg.
author | kazz@e065701.local |
---|---|
date | Fri, 23 Oct 2009 14:11:07 +0900 |
parents | 046feb56a196 |
children |
line wrap: on
line source
/** * PSXReply * * @author Shinji Kono * psx.in(),psxrd.() return this. method for check answer is ready or not. (call back interface can be used instead of this) unique sequence number */ package fdl; import java.nio.ByteBuffer; public class PSXReply { public ByteBuffer command; public ByteBuffer data; public int seq; public PSXReply next; public int mode; public PSXCallback callback; public PSXReply(int _mode,PSXCallback _callback) { mode = _mode; callback = _callback; } public PSXReply() { } public void setAnswer(int _mode, ByteBuffer _command,ByteBuffer _data) { mode = _mode; data = _data; command = _command; } public int getMode() { return command.get(PSX.LINDA_MODE_OFFSET); } public int getId() { return command.getShort(PSX.LINDA_ID_OFFSET); } public int getSeq() { return command.getInt(PSX.LINDA_SEQ_OFFSET); } public int getLength() { return command.getInt(PSX.LINDA_DATA_LENGTH_OFFSET); } public ByteBuffer getData() { data.rewind(); return data; } public boolean ready() { return mode==PSX.PSX_ANSWER; } } /* end */