View Javadoc

1   /******************************************************************
2   JADE - Java Agent DEvelopment Framework is a framework to develop 
3   multi-agent systems in compliance with the FIPA specifications.
4   Copyright (C) 2000 CSELT S.p.A. 
5   
6   GNU Lesser General Public License
7   
8   This library is free software; you can redistribute it and/or
9   modify it under the terms of the GNU Lesser General Public
10  License as published by the Free Software Foundation, 
11  version 2.1 of the License. 
12  
13  This library is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16  Lesser General Public License for more details.
17  
18  You should have received a copy of the GNU Lesser General Public
19  License along with this library; if not, write to the
20  Free Software Foundation, Inc., 59 Temple Place - Suite 330,
21  Boston, MA  02111-1307, USA.
22  *****************************************************************/
23  
24  package sl;
25  
26  
27  import java.util.List;
28  
29  /***
30     Interface for Content Language encoders/decoders. This interface
31     declares two methods that must convert between text and frame
32     representations according to a specific content language.
33  
34    @author Giovanni Rimassa - Universita` di Parma
35    @version $Date: 2003/10/09 13:00:37 $ $Revision: 1.1.1.1 $
36   */
37  public interface Codec {
38  
39  
40    /***
41       Encodes a t-uple of <code>Frame</code> objects into a Java
42       <code>String</code>, according to this Content Language and Ontology by
43       looking up the given ontology for the role played by symbols
44       (i.e. whether they are concepts, actions or predicates).
45       @param f The List of frames to encode as a t-uple.
46       @param o The ontology to use to lookup the roles for the various
47       symbols.
48       @return A Java string, representing the given frame according to
49       this content language.
50     */
51    String encode(List v, Ontology o);
52  
53    /***
54       Decodes a given <code>String</code>, according to the given
55       Content Language and obtains a t-uple of <code>Frame</code> objects.
56       This method can use the given ontology to distinguish among the different
57       kinds of roles a symbol can play (i.e. Concept vs. Action
58       vs. Predicate).
59       @param s A string containing the representation of an ontological
60       element, encoded according to this content language.
61       @param o The ontology to use to lookup the roles for the various
62       symbols.
63       @return A List of frame, representing the given ontological elements.
64    */
65    List decode(String s, Ontology o) throws CodecException;
66  
67  }