|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.ObjectJADE_SL.lang.Codec
JADE_SL.lang.StringCodec
JADE_SL.lang.sl.SLCodec
The codec class for the FIPA-SLn languages. This class
implements the Codec interface and allows converting
back and forth between strings and frames, according to the SL
grammar.
By default the class implements full SL grammar, otherwise the proper
value must be used in the constructor.
| Nested Class Summary |
| Nested classes inherited from class JADE_SL.lang.Codec |
Codec.CodecException |
| Field Summary | |
private static java.util.Vector |
FullSLFunctionals
|
static java.lang.String |
IOTA
Constant needed to create an AbsIRE(SLCodec.IOTA) |
private SLParser |
parser
|
(package private) static java.lang.String |
SEQUENCE
|
(package private) static java.lang.String |
SET
|
private static java.util.Vector |
SL0Functionals
|
private java.util.Vector |
vectorOfPredefinedFunctionals
Vector of all the functionals which have been pre-defined by FIPA and whose slots should not be encoded |
| Fields inherited from class JADE_SL.lang.Codec |
UNNAMEDPREFIX |
| Constructor Summary | |
SLCodec()
Construct a Codec object for the full SL-language (FIPA-SL). |
|
SLCodec(int slType)
Construct a Codec object for the given profile of SL-language. |
|
| Method Summary | |
AbsContentElement |
decode(Ontology ontology,
java.lang.String content)
Decodes the content to an abstract description. |
AbsContentElement |
decode(java.lang.String content)
Decodes the content to an abstract description. |
java.lang.String |
encode(AbsContentElement content)
Encodes a content into a String. |
private java.lang.String |
encode(AbsObject val,
boolean encodeSlotNames)
this method is used by all the toString methods and it exploits the common AbsObject implementation |
java.lang.String |
encode(Ontology ontology,
AbsContentElement content)
Encodes a content into a String. |
private java.lang.String |
encode(java.lang.String val)
Encode a string, taking care of quoting separated words and escaping strings, if necessary |
Ontology |
getInnerOntology()
|
private boolean |
isAWord(java.lang.String s)
Test if the given string is a legal SL0 word using the FIPA XC00008D spec. |
static void |
main(java.lang.String[] args)
|
private java.lang.String |
quotedString(java.lang.String s)
Take a java String and quote it to form a legal FIPA SL0 string. |
private boolean |
requiresSlotNames(java.lang.String conceptName)
|
private java.lang.String |
toString(AbsAggregate val)
|
private java.lang.String |
toString(AbsConcept val)
|
private java.lang.String |
toString(AbsIRE val)
|
private java.lang.String |
toString(AbsObject val)
|
private java.lang.String |
toString(AbsPredicate val)
|
private java.lang.String |
toString(AbsPrimitive val)
|
private java.lang.String |
toString(AbsVariable val)
|
| Methods inherited from class JADE_SL.lang.Codec |
getName |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
private SLParser parser
public static final java.lang.String IOTA
AbsIRE(SLCodec.IOTA)
static final java.lang.String SET
static final java.lang.String SEQUENCE
private java.util.Vector vectorOfPredefinedFunctionals
private static java.util.Vector SL0Functionals
private static java.util.Vector FullSLFunctionals
| Constructor Detail |
public SLCodec()
public SLCodec(int slType)
| Method Detail |
public java.lang.String encode(AbsContentElement content)
throws Codec.CodecException
encode in class StringCodeccontent - the content as an abstract descriptor.
CodecException
Codec.CodecException
public java.lang.String encode(Ontology ontology,
AbsContentElement content)
throws Codec.CodecException
encode in class StringCodecontology - the ontologycontent - the content as an abstract descriptor.
CodecException
Codec.CodecExceptionprivate java.lang.String quotedString(java.lang.String s)
private boolean isAWord(java.lang.String s)
private java.lang.String encode(java.lang.String val)
private java.lang.String encode(AbsObject val,
boolean encodeSlotNames)
throws Codec.CodecException
encodeSlotNames - if true and the name of the slot does not
start with Codec.UNNAMEDPREFIX, then the slotName is
also encoded, otherwise it is skipped.
Codec.CodecException
private java.lang.String toString(AbsPredicate val)
throws Codec.CodecException
Codec.CodecException
private java.lang.String toString(AbsIRE val)
throws Codec.CodecException
Codec.CodecException
private java.lang.String toString(AbsVariable val)
throws Codec.CodecException
Codec.CodecExceptionprivate boolean requiresSlotNames(java.lang.String conceptName)
private java.lang.String toString(AbsConcept val)
throws Codec.CodecException
Codec.CodecException
private java.lang.String toString(AbsAggregate val)
throws Codec.CodecException
Codec.CodecException
private java.lang.String toString(AbsPrimitive val)
throws Codec.CodecException
Codec.CodecException
private java.lang.String toString(AbsObject val)
throws Codec.CodecException
Codec.CodecException
public AbsContentElement decode(java.lang.String content)
throws Codec.CodecException
decode in class StringCodeccontent - the content as a String.
CodecException
Codec.CodecException
public AbsContentElement decode(Ontology ontology,
java.lang.String content)
throws Codec.CodecException
decode in class StringCodecontology - the ontology.content - the content as a String.
CodecException
Codec.CodecExceptionpublic static void main(java.lang.String[] args)
public Ontology getInnerOntology()
getInnerOntology in class Codec
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||