lib
Class LispPrimitiveParser

java.lang.Object
  extended by lib.LispPrimitiveParser
All Implemented Interfaces:
IPrimitiveReader

public class LispPrimitiveParser
extends java.lang.Object
implements IPrimitiveReader

Reads Primitives from .lisp files

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

Constructor Summary
LispPrimitiveParser()
           
 
Method Summary
 boolean canRead(java.lang.String strFile)
          Can this reader process the given file?
 java.util.ArrayList getActions(java.lang.String strFile)
          Get the list of action primitives file
 java.lang.String getDescription()
          Get the description of file
private  java.lang.String getFileContents(java.lang.String strFile)
          Read the contents of a text file
 java.util.ArrayList getSenses(java.lang.String strFile)
          Get the list of sense primitives from this file
private  void scanFor(LispBlob blob, java.util.ArrayList storeTo, java.lang.String scanText)
          Scan a blob of lisp for primitives of certain types
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LispPrimitiveParser

public LispPrimitiveParser()
Method Detail

getFileContents

private java.lang.String getFileContents(java.lang.String strFile)
Read the contents of a text file

Parameters:
strFile - File to load
Returns:
Contents of file

canRead

public boolean canRead(java.lang.String strFile)
Can this reader process the given file?

Specified by:
canRead in interface IPrimitiveReader
Parameters:
strFile - Path to file to read
Returns:
True if file contains primitives, false if not

getActions

public java.util.ArrayList getActions(java.lang.String strFile)
Get the list of action primitives file

Specified by:
getActions in interface IPrimitiveReader
Parameters:
strFile - Path to file to read.
Returns:
Arraylist of actions found in the file

getDescription

public java.lang.String getDescription()
Get the description of file

Specified by:
getDescription in interface IPrimitiveReader
Returns:
Description of the types of file this parser can read.

getSenses

public java.util.ArrayList getSenses(java.lang.String strFile)
Get the list of sense primitives from this file

Specified by:
getSenses in interface IPrimitiveReader
Parameters:
strFile - Path to file to read.
Returns:
Arraylist of sense primitives found in the file

scanFor

private void scanFor(LispBlob blob,
                     java.util.ArrayList storeTo,
                     java.lang.String scanText)
Scan a blob of lisp for primitives of certain types

Parameters:
blob - Blob of lisp we're working with
storeTo - Arraylist we're storing primitives to
scanText - Text that indicates the desired type.