jade.lang.acl
Class LEAPACLCodec

java.lang.Object
  |
  +--jade.lang.acl.LEAPACLCodec
All Implemented Interfaces:
ACLCodec

public class LEAPACLCodec
extends java.lang.Object
implements ACLCodec

This class implements the LEAP codec for ACLMessages.

Version:
$Date: 2005-09-16 15:54:46 +0200 (ven, 16 set 2005) $ $Revision: 5780 $
Author:
Jerome Picault - Motorola Labs, Giovanni Caire - TILAB

Nested Class Summary
 
Nested classes inherited from class jade.lang.acl.ACLCodec
ACLCodec.CodecException
 
Field Summary
static java.lang.String NAME
           
 
Fields inherited from interface jade.lang.acl.ACLCodec
DEFAULT_CHARSET
 
Constructor Summary
LEAPACLCodec()
           
 
Method Summary
 ACLMessage decode(byte[] data, java.lang.String charset)
          Recovers an ACLMessage object back from raw data, using the specific message representation to interpret the byte sequence.
static ACLMessage deserializeACL(java.io.DataInputStream dis)
           
static AID deserializeAID(java.io.DataInputStream dis)
           
 byte[] encode(ACLMessage msg, java.lang.String charset)
          Encodes an ACLMessage object into a byte sequence, according to the specific message representation.
 java.lang.String getName()
          Query the name of the message representation handled by this Codec object.
static void serializeACL(ACLMessage msg, java.io.DataOutputStream dos)
           
static void serializeAID(AID id, java.io.DataOutputStream dos)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NAME

public static java.lang.String NAME
Constructor Detail

LEAPACLCodec

public LEAPACLCodec()
Method Detail

encode

public byte[] encode(ACLMessage msg,
                     java.lang.String charset)
Encodes an ACLMessage object into a byte sequence, according to the specific message representation.

Specified by:
encode in interface ACLCodec
Parameters:
msg - The ACL message to encode.
charset - This parameter is not taken into account
Returns:
a byte array, containing the encoded message.

decode

public ACLMessage decode(byte[] data,
                         java.lang.String charset)
                  throws ACLCodec.CodecException
Recovers an ACLMessage object back from raw data, using the specific message representation to interpret the byte sequence.

Specified by:
decode in interface ACLCodec
Parameters:
data - The byte sequence containing the encoded message.
charset - This parameter is not taken into account
Returns:
A new ACLMessage object, built from the raw data.
Throws:
CodecException - If some kind of syntax error occurs.
ACLCodec.CodecException

getName

public java.lang.String getName()
Query the name of the message representation handled by this Codec object. The FIPA standard representations have a name starting with "fipa.acl.rep.".

Specified by:
getName in interface ACLCodec
Returns:
The name of the handled ACL message representation.

serializeACL

public static final void serializeACL(ACLMessage msg,
                                      java.io.DataOutputStream dos)
                               throws java.io.IOException
java.io.IOException

deserializeACL

public static final ACLMessage deserializeACL(java.io.DataInputStream dis)
                                       throws java.io.IOException
java.io.IOException

serializeAID

public static final void serializeAID(AID id,
                                      java.io.DataOutputStream dos)
                               throws java.io.IOException
java.io.IOException

deserializeAID

public static final AID deserializeAID(java.io.DataInputStream dis)
                                throws java.io.IOException
java.io.IOException


JADE