ubiware.core
Class SaplN3Producer

java.lang.Object
  extended by ubiware.core.SaplN3Producer

public class SaplN3Producer
extends java.lang.Object

This class produces a S-APL N3 String from the beliefs strucure of the UbiwareAgent. This is a faster implementation of the version by Arthem Katasonov. Speed improvement is mainly achieved by not generating unused ID's 23.6.2010

Author:
Michael Cochez for UBIWARE project

Constructor Summary
SaplN3Producer(UbiwareAgent agent, ResourcePrefixer prefixer, ProduceN3Options options)
           
 
Method Summary
 java.lang.String produceN3(ContextContainer c)
          Produce S-APL N3 for the given ContextContainer.
 java.lang.StringBuilder produceN3(ContextContainer c, java.lang.StringBuilder builder)
          Produce S-APL N3 for the given ContextContainer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SaplN3Producer

public SaplN3Producer(UbiwareAgent agent,
                      ResourcePrefixer prefixer,
                      ProduceN3Options options)
Method Detail

produceN3

public java.lang.StringBuilder produceN3(ContextContainer c,
                                         java.lang.StringBuilder builder)
Produce S-APL N3 for the given ContextContainer. This method produces less nice looking S-APL since for performance reasons, the prefixes are generated after the S-APL code. This S-APL is valid but looks less nice. Use the version which does not take a StringBuilder as an argument to generate S-APL for visual presentation.

Parameters:
c - The ContextContainer
builder - The StringBuilder into which the sapl code should be ge
Returns:
A string containing the S-APL N3 code.

produceN3

public java.lang.String produceN3(ContextContainer c)
Produce S-APL N3 for the given ContextContainer.

Parameters:
c - The ContextContainer
Returns:
A string containing the S-APL N3 code.