org.rosuda.JRclient
Class Rpacket

java.lang.Object
  extended by org.rosuda.JRclient.Rpacket

public class Rpacket
extends java.lang.Object

small class encapsulating packets from/to Rserv

Version:
$Id: Rpacket.java 2071 2006-03-09 22:07:21Z dmao $

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