lib
Class DotLapWriter

java.lang.Object
  extended by lib.DotLapWriter

public class DotLapWriter
extends java.lang.Object

DotLapWriter is responsible for exporting our learnable action pattern object as a .lap file.

Version:
1.0
Author:
CobaltSoftware (abode.devteam@cobaltsoftware.net)

Constructor Summary
DotLapWriter()
           
 
Method Summary
private  java.lang.String generateLispFromActionElement(ActionElement element)
          Convert an action element into lisp
private  java.lang.String generateLispFromActionPattern(ActionPattern pattern)
          Convert an ActionPattern object into lisp
private  java.lang.String generateLispFromCompetence(Competence competence)
          Convert a competence into lisp form
private  java.lang.String generateLispFromCompetenceElement(CompetenceElement compElement)
          Convert a competence element into it's lisp representation
private  java.lang.String generateLispFromDriveCollection(DriveCollection driveCollection)
          Convert a drive collection into it's lisp representation
private  java.lang.String generateLispFromDriveElement(DriveElement driveElement)
          Generate a block of lisp from a drive element
private  java.lang.String generateLispFromGoal(java.util.ArrayList goal)
          A Goal is stored as an arraylist of actionelements, so parse that into a lispy-format
 java.lang.String generateLispFromLAP(LearnableActionPattern data)
          Process the learnableactionpattern object
private  java.lang.String generateLispFromTimeUnit(TimeUnit timeUnit)
          Convert a timeunit into a lisp element
private  java.lang.String generateLispFromTrigger(java.util.ArrayList trigger)
          A trigger is stored as an arraylist of actionelements
 void save(java.lang.String fileName, LearnableActionPattern data)
          Save data to a file
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DotLapWriter

public DotLapWriter()
Method Detail

save

public void save(java.lang.String fileName,
                 LearnableActionPattern data)
Save data to a file

Parameters:
fileName - Path to file to save to.
data - Object model of this file

generateLispFromLAP

public java.lang.String generateLispFromLAP(LearnableActionPattern data)
Process the learnableactionpattern object

Parameters:
data - The object model
Returns:
Lisp string representation

generateLispFromDriveCollection

private java.lang.String generateLispFromDriveCollection(DriveCollection driveCollection)
Convert a drive collection into it's lisp representation


generateLispFromDriveElement

private java.lang.String generateLispFromDriveElement(DriveElement driveElement)
Generate a block of lisp from a drive element

Parameters:
driveElement - A Drive Element
Returns:
Lisp representation of element

generateLispFromCompetence

private java.lang.String generateLispFromCompetence(Competence competence)
Convert a competence into lisp form

Parameters:
competence - A Competence
Returns:
Lisp representation of the competence

generateLispFromCompetenceElement

private java.lang.String generateLispFromCompetenceElement(CompetenceElement compElement)
Convert a competence element into it's lisp representation

Parameters:
compElement - Competence Element
Returns:
Lisp representation of the competence element

generateLispFromTrigger

private java.lang.String generateLispFromTrigger(java.util.ArrayList trigger)
A trigger is stored as an arraylist of actionelements

Parameters:
trigger - Arraylist of action elements comprising the trigger
Returns:
String/lisp representation of the trigger

generateLispFromGoal

private java.lang.String generateLispFromGoal(java.util.ArrayList goal)
A Goal is stored as an arraylist of actionelements, so parse that into a lispy-format

Parameters:
goal - Arraylist represetnation of goal, which is really just the same as an arraylist of action elements
Returns:
Lisp represntation of the goal

generateLispFromActionPattern

private java.lang.String generateLispFromActionPattern(ActionPattern pattern)
Convert an ActionPattern object into lisp

Parameters:
pattern - Action pattern construct
Returns:
Lisp representation of the action pattern

generateLispFromActionElement

private java.lang.String generateLispFromActionElement(ActionElement element)
Convert an action element into lisp

Parameters:
element - Action Element object
Returns:
Lisp representation of an action pattern element

generateLispFromTimeUnit

private java.lang.String generateLispFromTimeUnit(TimeUnit timeUnit)
Convert a timeunit into a lisp element

Parameters:
timeUnit - A measure of time
Returns:
String/lisp representation