jade.lang.acl
Interface ACLCodec
- All Known Implementing Classes:
- StringACLCodec
- public abstract interface ACLCodec
Abstract interface for converting ACL messages back and forth
between Java objects and raw byte sequences, according to a FIPA
ACL message representation.
- Author:
- Giovanni Rimassa - Universita` di Parma
|
Inner Class Summary |
static interface |
ACLCodec.CodecException
This exception is thrown when some problem occurs in the concrete parsing
subsystem accessed through this interface. |
|
Method Summary |
ACLMessage |
decode(byte[] data)
Recovers an ACLMessage object back from raw data,
using the specific message representation to interpret the byte
sequence. |
byte[] |
encode(ACLMessage msg)
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. |
encode
public byte[] encode(ACLMessage msg)
- Encodes an
ACLMessage object into a byte sequence,
according to the specific message representation.
- Parameters:
msg - The ACL message to encode.- Returns:
- a byte array, containing the encoded message.
decode
public ACLMessage decode(byte[] data)
throws ACLCodec.CodecException
- Recovers an
ACLMessage object back from raw data,
using the specific message representation to interpret the byte
sequence.
- Parameters:
data - The byte sequence containing the encoded message.- Returns:
- A new
ACLMessage object, built from the raw
data. - Throws:
- ACLCodec.CodecException - If some kind of syntax error occurs.
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.".
- Returns:
- The name of the handled ACL message representation.