org.rosuda.REngine.Rserve.protocol
Class RPacket

java.lang.Object
  extended by org.rosuda.REngine.Rserve.protocol.RPacket

public class RPacket
extends java.lang.Object

small class encapsulating packets from/to Rserv

Version:
$Id: RPacket.java 2743 2007-05-04 16:42:17Z urbanek $

Constructor Summary
RPacket(int Rcmd, byte[] Rcont)
          construct new packet
 
Method Summary
 int getCmd()
          get command
 byte[] getCont()
          get content
 int getStat()
          get status code of last response
 boolean isError()
          check last response for RESP_ERR
 boolean isOk()
          check last response for RESP_OK
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RPacket

public RPacket(int Rcmd,
               byte[] Rcont)
construct new packet

Parameters:
Rcmd - command
Rcont - content
Method Detail

getCmd

public int getCmd()
get command

Returns:
command

isOk

public boolean isOk()
check last response for RESP_OK

Returns:
true if last response was OK

isError

public boolean isError()
check last response for RESP_ERR

Returns:
true if last response was ERROR

getStat

public int getStat()
get status code of last response

Returns:
status code returned on last response

getCont

public byte[] getCont()
get content

Returns:
inner package content

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object